Doc-To-Help Standard Manual
by Robelle Solutions Technology Inc.
Program and manual copyright © 1977-2022 Robelle Solutions Technology Inc.
Permission is granted to reprint this document (but not for profit), provided that copyright notice is given.
Updated October 28, 2021
Qedit and Suprtool are trademarks of Robelle Solutions Technology Inc. Windows is a trademark of Microsoft Corporation. Other product and company names mentioned herein may be the trademarks of their respective owners.
Robelle Solutions Technology Inc.
7360 – 137 Street, Suite 372
Surrey, B.C. Canada V3W 1A3
Phone: 604.501.2001
Fax: 604.501.2003
E-mail: sales@robelle.com
E-mail: support@robelle.com
Web: www.robelle.com
Contents
Getting a Quick Start with Line
Mode Editing
Open and Shut for Instant Access
Initial Command Line: -ccmdstring
Converting Qedit Files with qcat
Differences Between MPE and LINUX
Files without NewLine Characters
Stopping Commands with Control-Y
Add (Adding a String as a Line)
Add (Copying Lines within a File)
Add (Moving Lines within a File)
Add (Copying Lines Between Files)
:Listredo Command [LISTREDO/F7]
Troubleshooting and Error Messages
Escaped Sequences in Regular
Expressions
Backreferences in Regular
Expressions
Escaped Characters in Replacement
String
? Means Help, Nonprinting
Characters, Alphanumeric (in Patterns) or Optional (in Regexp)
$ Means Hex, Memory Lock, List
Option, Previous File or End-Of-Line (in Regexp)
^ Means Findup, Control-Char,
Start-of-line (in Regexp) or Negate (in Regexp)
. Means Nonprinting, Reset, Decimal
Point or Any Character (in Regexp)
! Means Shell Script or Too Long
* Means Current, Refresh, Multiply
or Quantifier (in Regexp)
\ Means Previous, String, Literal
Match (in Regexp) or Special Characters (in Regexp)
/ Means Prompt, Range Delimiter,
Stop, Exit, or Divide
[ Means FIRST, [default] or Start
Class (in Regexp)
] Means LAST or End Class (in
Regexp)
{ } Are for Comments or Indentation
: Means Shell Commands or String
< Means Move, I/O Redirection or
Backward Page
> Means Forward Page, I/O
Redirection, Modify or Qhelp
( Means Start Parameter, Command or
Subpattern (in Regexp)
) Means End Parameter, Command or
Subpattern (in Regexp)
+ Means Ahead Some Lines, Add or
Quantifier (in Regexp)
- Means Back Some Lines, Minus or Range (in
Regexp)
Welcome to Qedit, the fast, full-screen text editor for MPE, HP-UX and LINUX. To get into Qedit/Open, enter this command:
/opt/robelle/bin/qedit
Qedit version 6.3 has line mode editing and commands:
Commands:
Add |
FINDUp |
Open |
ZZ |
Add(=copy) |
FORM |
Proc |
%ext |
Add(<move) |
FORward |
Q |
shell |
Add(=file) |
GARbage |
REDO |
|
Append |
Glue |
RENum |
|
Backward |
Help |
Replace |
|
Before |
HOld |
Set |
|
Change |
Justify |
SHut |
|
COLcopy |
Keep |
SPell |
|
COLMove |
List |
Text |
|
Delete |
LISTREDO |
UNDo |
COmp |
DEStroy |
LISTUndo |
Use |
RUN |
Divide |
LSort |
Verify |
mpe |
DO |
MErge |
Visual* |
Udc |
Exit |
Modify |
Words |
Cmdfile |
Find |
New |
Zave |
=calc |
Qedit comes with a User
Manual and a Change Notice. You may have received printed copies of these. If
you wish to have printed copies, you can order them by filling out the form on
our web site.
They are also available as PDF or HTML files. You can download the
files from the Robelle web site at: http://www.robelle.com/library/manuals/.
The user manual contains the full description of all the Qedit
commands, as well as usage tips. The manual is up-to-date with all the latest
changes incorporated in Qedit.
Qedit comes with additional software:
· qcat for converting Qedit files,
· qaccess archive library for reading Qedit files
Qcat is a filter program similar to cat and zcat. Qcat reads a set of Qedit files and prints the lines on standard output. Type man qcat for more information.
qcat QeditFile > TextFile
Qaccess is an archive library for reading Qedit files. It has two parts:
· a header file qaccess.h in /opt/robelle/include,
· and an archive library qaccess.a in /opt/robelle/lib.
Type man qaccess for more information.
This manual uses a standard notation to describe commands. Here is a sample definition:
VERIFY [ @ | ALL ]
[ keyword ...]
1. UPPERCASE - If the commands and keywords are shown in uppercase characters in a syntax statement, they must be entered in the order shown (example: ALL). However, you can enter the characters in either uppercase or lowercase.
2. Lowercase, highlighted - These are "variables" to be filled in by the user (example: keyword). The variables may be highlighted by underlining or italics. Each such "variable" is defined elsewhere (see the "Qedit Glossary" on page 211 when you have trouble). In the Help command, highlighting is not available, so these variables appear simply in lowercase.
3. Brackets - enclose optional fields (example: [ALL]).
4.
Braces - enclose comments which
are not part of the command. However, braces and comments are accepted in
actual Qedit commands.
/listq filename {Q means without line numbers}
5. Up lines - separate alternatives from which you select (example: SET CHECK [ON|OFF]). The choices are sometimes listed on several lines without "up lines".
6. Dot-dot-dot (...) - indicates that the variable may be repeated many times in the command.
7. Other special characters - literal symbols that must appear in the command as they appear in the manual (for example, "=" in Add linenum = rangelist).
In examples, there is an implied Return key at the end of each line.
In examples in our documentation, we generally show Qedit commands preceded by the Qedit "/" prompt. However, in Qedit/Open the default prompt is actually "qux/". Note that you can change the prompt string with Set Prompt.
Control characters, generated by holding down Control while striking another key, are either spelled out (e.g., Control-H) or abbreviated with a circumflex prefix (e.g., ^H).
When Qedit asks you a question, the default answer is shown in [brackets]. The default is the answer that Qedit will assume if you press only the Return key.
· Add with move syntax would abort, this is now fixed. A typical syntax is add last < 1/3.
·
Adding
a block of text would incorrectly print out line numbers at the end of the
block of text. For the time being ADD will revert to ADDQ while we investigate
this issue.
· The Modify command will default to Modifyq for the time being as to when we resolve some terminal issues.
· Qedit has been ported to Linux, specifically Small Endian Linux Machines.
You don't have to learn every command in order to use Qedit. With just a few of the basic functions, you can take care of editing job streams, programs, memos, or big text files. First, find out how to run Qedit on your system. Your system manager may have set up an easy way to access Qedit (try typing qedit). Look for a slash prompt (/ on MPE or qux/ on LINUX), which tells you Qedit is ready to go.
This introduction will make the following activities familiar to you: adding lines to a file, looking at the contents of files, searching files for specific characters, changing one line or many lines, deleting, moving, and copying lines, and saving files. In the examples to follow, watch for comments on the right-hand side, enclosed in curly braces. Whatever you see in { } is an explanation, not part of the command, although Qedit will accept it. Press Return after each command line. When you finish your session, getting back out of Qedit is easy. Type Exit, and press the Return key:
/exit
You add text with the Add command. Qedit numbers each line you add. Pressing Return at any spot in the line moves you to a new line. This means that you can put a blank line into your text if you press Return twice in a row. Qedit continues to add your lines of text until you type // (two slashes) at the beginning of a new line and press Return. Try typing Add right now, and Qedit moves the cursor and prints some identifying information:
/add {remember to press Return}
QEDITSCR {Qedit displays this line}
Temporary File List * = 1 {and this line too}
1 _ {go on, Qedit is waiting for you}
Continue to "add" by typing in this example:
1 MEMO TO: Drama Staff, News Simulation Dept.
2
3 FROM: Marie Reimer, Publicity Dept.
4
5 Please check your in-baskets daily and
6 respond to your fan mail within a week.
7 // {stop adding for now}
/ {Qedit is waiting again}
You can add lines anywhere in the file by typing Add followed by the line number where you want to start your insertion. For example, if you decide to date this memo, type at the slash prompt:
/add 2
2.1 DATE: November 18, 2000
2.2
2.3 //
/
You have added line 2.1 for the date, and line 2.2, which is blank. Line 2.3 is not put into your file, since typing the double slash stopped the adding. Notice that Qedit used line numbers that would fit between line 2 and line 3. Now, if you want to see what the whole thing looks like, type List ALL at the slash prompt.
/list all
1 MEMO TO: Drama Staff, News Simulation Dept.
2
2.1 DATE: November 18, 2000
2.2
3 FROM: Marie Reimer, Publicity Dept.
4
5 Please check your in-baskets daily and
6 respond to your fan mail within a week.
/
The command for looking at the file is List. But you can do much more than List ALL. For example, you can list a file you're not even working on. Our sample memo is a temporary file, in your group, named Qeditscr, but you could look at a file in another group now without harming the memo by typing, for example:
/list /etc/profile
The file /etc/profile may be scrolling by on your screen, but don't panic.
If you want to browse through the file, the command you need is LJ. LJ stands for List-Jump. Qedit shows you a screen of text, prints
More?[yes]
at the bottom of the screen, and waits for you. If you press Return, Qedit displays the next screen. You can stop browsing by pressing Control-Y, typing NO or just N, or by typing //. Also, you can type any command, and Qedit stops browsing to execute it. To request a List-Jump:
/lj 6 {begin browsing at line 6}
/lj /etc/profile {browse configuration file}
So far, you typed line numbers to specify which lines you wanted to see. There is another way to list lines, and that is to specify an identifying string. Put anything in quotes and it's a string. Qedit lists all the lines that contain that exact same "anything".
/list "your"
5 Please check your in-baskets daily and
6 respond to your fan mail within a week.
2 lines found
There are two occurrences of "your" in the file, one on line 5 and one on line 6.
Strings can help you find a particular place in the file quickly.
With the commands Find and Findup, you can go to the next consecutive location of a string. Find searches the file from your current location to the end. Findup searches backwards from where you are to the beginning. So in order to search a file for a date scattered throughout it, type:
/find "January 18" {search forward from current line}
Or, search back through the file with
/findup "January 18"
Qedit displays the next line containing "January 18". To search again for the same string, just type Find (or Findup). You can abbreviate "Find" to "F" and "Findup" to "^".
/f
To search for a different string, just type F "new string".
Suppose you want to change the date of your memo. You could do it the slow way, first deleting the line, then adding a replacement line with the new date. But instead of all that retyping, try the Modify command. Modify has a lot of power. Here's how to use it:
1. Type M and the line number.
2. Qedit displays the line, and you move along on the line below it by pressing the space bar.
3. Stop at the point where you want to make your correction.
4. Type in the change to be inserted and press Return.
5. Qedit displays the entire corrected line for your approval. Make another correction if you want, and when satisfied, press Return again to accept the corrected line and get back to the slash prompt.
An example:
/m2.1
2.1 DATE: November 18, 2000
9 {move with the space bar}
{press Return}
2.1 DATE: November 19, 2000 {press Return again}
Here is a partial list of special things you can do with Modify:
^B |
insert text Before this column |
^D |
DELETE text from this column onward |
^L |
add text after the LAST column in the line |
^O |
OVERWRITE (or replace) columns |
^T |
TRAVEL over the line without changing it |
^G |
GOOFED. Put the line back the way it was, please |
Note: The little symbol ^ is a shorthand way of saying that you hold down the Control key (on some keyboards abbreviated Ctrl) while at the same time pressing the letter. For example, ^B (or Control-B): keep the Control key down with one finger while with another, type a B. These symbols won't show up on your screen.
LINUX reacts to certain control characters which might conflict with the Qzmodify codes. For example, control-D sends an end-of-file signal to LINUX but is also the delete character in Qzmodify. You should use the LINUX stty program to change the default end-of-file signal. Please see the section "Error! Reference source not found." for more details.
This command is easy to use but awkward to describe; you'll understand how to use it much faster if you give it a try. Let's take a typical example, and modify line 5 of our memo. Begin by typing "m5" and, of course, pressing Return. Then, to replace "daily" with "every day", our first step is to delete the word. Use the space bar to move to the column under the "d" in "daily". Press ^D (you won't see anything, remember), then space across all the columns you want to delete. Don't press Return yet.
The second step is to insert the two new words. Press ^B and type "every day". Now press Return to see the line with the revisions.
Qedit lets you see your revisions and continue modifying with as many different changes as you can fit into one pass, before you press Return. In order to make changes at different locations in a line, press ^T to space over the intervening characters without disturbing them. If you goofed, press ^G instead: you'll get your original line back.
The final step is to accept the revisions by pressing Return one last time.
If your fingers are so trained to MPE's style of Modify (e.g., D for delete) that you cannot remember to use the Control key, do not despair. As with most things in Qedit, there is a configuration option to solve this problem. The command Set Mod HP instructs Qedit to accept HP-style modifies (i.e., MPE modifies such as D and I), instead of Qedit-style. See the Modify section of the Set command.
There is another way to modify lines in your workfile. The Change command allows you to make changes throughout the entire file, without the bother of working on each line one by one. For example, with one Change command to your memo, you can replace all the colons with dashes.
/change ":"-" all
1 MEMO TO- Drama Staff, News Simulation Dept.
2.1 DATE- November 19, 2000
3 FROM- Marie Reimer, Publicity Dept.
3 lines changed
Using the Change All command is a one-way street. If we now decide we don't like the dashes and want to get the colons back, observe what happens to Line 5.
/change"-":" all
1 MEMO TO: Drama Staff, News Simulation Dept.
2.1 DATE: November 19, 2000
3 FROM: Marie Reimer, Publicity Dept.
5 Please check your in:baskets daily and
4 lines changed
This second Change command has gotten us into hot water. Luckily, Qedit has an Undo command that takes your file step-by-step backwards to put it back to the way it was. See the Undo command in the "Qedit Commands" chapter.
CJ Command
If you're not sure what the consequences of a global change will be, use the CJ command. CJ stands for Change-Jump. Qedit shows you each line it means to change, and waits for you to approve, to change your mind, or to modify that line. Then Qedit jumps to the next occurrence of your string, and repeats its question until you have dealt with all occurrences of the string in the file. To accept the default answer of NO (i.e., don't replace the string), shown in square brackets, just press Return.
/cj":"-" all
1 MEMO TO: Drama Staff, News Simulation Dept.
Change okay (Y,N or Modify) [No]: {press Return}
2.1 DATE: November 19, 2000
Change okay (Y,N or Modify) [No]: {press Return}
3 FROM: Marie Reimer, Publicity Dept.
Change okay (Y,N or Modify) [No]: {press Return}
5 Please check your in:baskets daily and
Change okay (Y,N or Modify) [No]:Yes
1 line changed
You can use the handy ^Y to stop in the midst of change-jumping just as you used it to stop listing.
Rangelist
You can also specify individual lines or a rangelist to Change. For example,
/change "Dept."Department" 1/3
1 MEMO TO: Drama Staff, News Simulation Department
3 FROM: Marie Reimer, Publicity Department
2 lines changed
/change "Drama Staff, "" 1 {changes string to nothing}
{i.e., deletes it}
1 MEMO TO: News Simulation Department
1 line changed
Copying lines is a variation of the Add command. One reason we might want to copy lines is to make a general-purpose form out of our memo. We can keep a sample memo form at the beginning of the file, then copy it to the end of the file and fill it in whenever we need to communicate. This is how to do it:
/add last = first/4
7 MEMO TO: News Simulation Department
8
9 DATE: November 18, 2000
10
11 FROM: Marie Reimer, Publicity Department
12
6 lines COPIED
Qedit copies the rangelist (first/4 = first line to line 4) after the indicated line (here, last line in file). To accomplish our goal of placing the sample memo template at the beginning of the file, we'll have to move the first six lines so they follow our new sample. Before we try moving lines, a last tip on copying: you can copy lines from an external file by including the file name in the command, placed after the equals sign and right before the rangelist.
Moving is very similar to copying; it's another form of the Add command. But, instead of using the equals sign, use the less-than sign. You can specify:
/add 12 < 1/6
13 MEMO TO: News Simulation Department
14
15 DATE: November 18, 2000
16
17 FROM: Marie Reimer, Publicity Department
18
19 Please check your in-baskets daily and
20 respond to your fan mail within a week.
8 lines MOVED
Qedit moves the rangelist (in this case, lines 1 to 6) after the indicated line (in this case, 12). In case you were wondering, we could have used "last" instead of the number "12". You can add, move, or copy lines to any spot. In fact, we could have copied the first six lines to the beginning of the file in the first place, but then we wouldn't have had this fascinating "move" example. The result of this particular move is
/list all
7 MEMO TO: News Simulation Department
8
9 DATE: November 18, 2000
10
11 FROM: Marie Reimer, Publicity Department
12
13 MEMO TO: News Simulation Department
14
15 DATE: November 18, 2000
16
17 FROM: Marie Reimer, Publicity Department
18
19 Please check your in-baskets daily and
20 respond to your fan mail within a week.
To demonstrate the Delete command, we'll get rid of our memo template. On some systems, Qedit asks for confirmation before deleting a large number of lines. If so, you can cancel the deletion just by pressing Return; to confirm the deletion, type "yes" and press Return. The abbreviation for Delete is simply D :
/d first/12
7 _MEMO TO: News Simulation Department
8 _
9 _DATE: November 18, 2000
10 _
11 _FROM: Marie Reimer, Publicity Department
12 _
DELETE 6 lines [no]? yes
If you typed "yes" without due consideration, you now have a chance to take it back. Press Control-Y, and Qedit saves your bacon with the message "Undeleted!" But you must press Control-Y immediately: if you do anything else between the deletion and the rescue, Qedit will commit to the deletion. However, in this situation the Undo command can bring your lines back, even if you have made more changes. You must undo each change to the file in reverse order. See the "Qedit Commands" chapter of the manual for details.
There are two commands that preserve your work: Keep and Shut. First, invent a name for your file. Naturally, two files cannot have the same name. The name must be a valid LINUX file name. We've been working on a temporary file. To save it, name it:
/keep myfile1
When you want to work on Myfile1 again, type:
/text myfile1
and Qedit will copy Myfile1 for you to use. If you make changes to the file, remember to Keep it again before you leave Qedit to make the changes a permanent part of the file.
Only Qedit files can be opened and shut. It is much faster to use the Open command than it is to use the Text command, because you make changes directly to the Open file. With a Text file, you must wait for Qedit to make a copy to which you make your changes.
Using the Shut command saves the current scratchfile as a permanent Qedit workfile. In the case of a scratchfile, the name of the new workfile must not exist. You can Shut a new file, or a file that you made a copy of (with the Text command). Name the file as described above.
If you are working on a Qedit workfile, Qedit renames it before closing.
qux/t myfile1
'Language' is now DATA {copy of myfile1 in scratchfile}
20 lines in file
qux/sh myfile1
Retained existing file for you. {myfile1 already exists. No change.}
qux/sh myfile1.work {renamed to myfile1.work}
qux/open *
Open /home/user1/myfile1.work Current = 1 Margins = 1/80
qux/sh myfile1.newwork
File renamed.
A workfile looks like any other file from the outside. For example,
ll myfile1*
-rw-rw-rw- 1 francois users 533 Aug 17 18:33 myfile1
-rw-rw-rw- 1 francois users 16384 Dec 8 07:15 myfile1.work
However, you can use the LINUX file command to determine the file type. In order for file to recognize Qedit files, you need to edit /usr/share/file
login as root
$ cd /usr/share/file
$ qedit
qux/Text magic
qux/Add last
0\tstring\tQEDIT\tQedit {\t indicates tab characters}
//
qux/Set Decimal On
qux/Change "\t" '9 * {change \t to actual tab characters}
qux/Keep
You can now use the file command on these files.
$ file myfile1*
myfile1: ascii text
myfile1.work: Qedit
To run Qedit for LINUX, type this command:
/opt/robelle/bin/qedit
Qedit. Copyright Robelle Solutions Technology Inc. 1977-2001.
(Version cd ) Type ? for help.
qux/
Qedit prints its version number and prompts with "qux/". You type commands, ending each with Return. For example, to edit a file enter a Text command:
qux/text filename
To save your edits, use the Keep command.
Qedit's primary scratch file is called "Qeditscr." By default, this file is created in /var/tmp (/usr/tmp is the default on older versions of LINUX) or the path name specified in the TMPDIR environment variable. The scratchfile name is qscr.xxxxxxxxx where "xxxxxxxxx" is a random string generated by the LINUX tempnam routine.
If you want to move scratch files to a different directory, you can set the TMPDIR environment variable.
TMPDIR=/home/user1/tmp
export TMPDIR
Keep in mind that Qedit works with absolute filenames and these names can not have more than 240 characters. Whenever you use the default options for Opening or Texting a file, your work will be in the Qeditscr scratch file.
What if you want to edit two or more files and copy lines between them? You could Text the first file, Hold the selected lines, Keep your changes, then Text the second file and insert the lines. However, if you are doing numerous edits, the constant Text and Keep operations are inconvenient.
It is faster to Text each file into an extra scratch file of its own. Then use the "Open ?" or the "Open *-n" command to switch quickly between them. By default, Text always copies the file into the Qeditscr scratch file. However, Qedit can supply up to eight extra scratch files. To Text a file called abcd into an extra scratch file, type:
qux/text abcd,new
When you Exit, Qedit checks whether you have any unsaved edits in any of your scratch files. If there are some unsaved edits, Qedit prompts you to "Discard?" them or to stay in Qedit to save them with the Keep command.
Sometimes you start editing a new document and have nothing to Text to create the extra scratch file. In this case, use the New command without parameters.
/new
Qedit creates a new extra scratch file and assigns it a sequential number (1,2,3...). If you use an Open ? command, you would see "Extra Scratch file #2" in the list of files. If you do a Keep or Set Keep Name command, you would see the Keep file as the Text name in Open ?.
When you log on to LINUX, a program is run called the shell. The shell program interprets commands, executes them, and controls command execution. Making configuration changes requires that you know which shell you are using and what files are automatically executed.
The BASH shell on Linux is the default shell on most versions of Linux. The Bourne Again Shell, is named as such in tribute to Steve Bourne’s shell.
The BASH shell executes the file /etc/profile and your local cd / .bash_profile when you log on to Linux.
You can invoke Qedit with the command:
/opt/robelle/bin/qedit
If you want to be able to just type
qedit
to invoke Qedit/Open, you must either add /opt/robelle/bin to your PATH or copy /opt/robelle/bin/qedit to a directory that is currently on your PATH. Similarly, the man pages for Qedit are found in /opt/robelle/man/man1/qedit.1. To make the man pages available to everyone, you can either add /opt/robelle/man to your MANPATH or you can copy the man pages to a directory that is currently on your MANPATH.
The easiest way to change the two PATHs for all users on your LINUX machine is to log on as root and add these two lines to the file /etc/profile after any existing PATH or MANPATH statements:
PATH=$PATH:/opt/robelle/bin
MANPATH=$MANPATH:/opt/robelle/man
Remember to delete any PATH or MANPATH settings in /etc/d.profile, so that new users do not override your changes. You also have to warn existing BASH shell users to change the .bash_profile file in their home directories.
When you run Qedit, it automatically "uses" two configuration files if they exist: /opt/robelle/qeditmgr and .qeditmgr in your home directory. The system manager usually creates /opt/robelle/qeditmgr and puts Qedit commands in it to set Qedit options. To check the options for your site, List this file.
If you want a personal Qeditmgr file, create the file .qeditmgr in your home directory. This file is in addition to the global Qeditmgr file which is always executed first.
Qedit treats the Qeditmgr file exactly like a usefile, so Qeditmgr can include any Qedit commands. The Set commands let you configure Qedit so it has the ideal defaults for your shop (e.g., Set Lang Cobol ...). Here is a typical Qeditmgr file:
{These are default qedit values for all users:}
set lang cobolx all on
set x date list off {mark changed lines with date}
set check on {verify delete/format of >5 lines}
set list page on {lp listings interpret $page}
z=list */last {define z command}
For details on Set commands, refer to the "Qedit Commands" chapter.
If one set of defaults is not appropriate for everyone on your system, it is possible to set up personal Qeditmgr files in each user's home directory. See the chapter "Running Qedit on LINUX" for details.
You normally run Qedit as an on-line session. You type Qedit commands on your terminal and Qedit prints responses on your terminal. If you redirect stdin or stdlist, Qedit assumes that it is in batch.
Qedit in batch is almost identical to Qedit on-line, except for answering questions. When Qedit asks a question in batch, no one is there to answer it. Therefore, Qedit does not expect an answer from stdin. Qedit assumes that you want your batch task to complete, so it always selects the option that will complete the command successfully. This is normally a "YES" answer, as in "yes, clear the file" or "yes, upshift the line". Qedit prints the question on stdlist, as well as the answer that it has selected for you.
When Qedit encounters an error in batch, no one is there to correct it. Therefore, Qedit normally aborts. However, you can use Set Autocont On to override this abort, instructing Qedit to keep processing after errors in batch.
You can invoke Qedit/Open with options, or an initial file name to edit, or both (or neither). The syntax for invoking Qedit/Open is:
qedit [-csv] [filename]
See below for suggestions on setting the EDITOR environment variable so that Qedit is automatically invoked as your editor from other tools like elm.
You can specify commands to be executed using the -c option before the file name. The -c is followed by commands to be executed. There must be no space between the -c and the command list.
If those commands contain a space, they must be enclosed in single or double quotes; otherwise, the quotes are optional. When both -c and a file name occur, the –c commands are executed after the file is accessed for editing. Here are some examples:
qedit -cvisual myfile
qedit -c"visual" myfile
qedit -c'set vis ab 3 bel 12;visual' myfile
qedit -c"text abc;use fixit;k,y;e"
Sometimes you want to invoke Qedit for a specific purpose, such as writing a message in elm. You are using Qedit as a dedicated tool for a specific purpose. In these cases, specify -s and a file name. You can only edit that file and it will be saved on exit. You will not be allowed to edit any other files.
qedit -cvisual -s myfile
/exit
Save your changes (yes/no)?
Some users find that they Exit from Qedit inadvertently by pressing F8 too many times. To require user approval on Exit, use the -v option.
qedit -v
/e
Okay to exit [no]:
/
Qedit needs to purge your random-named scratch files when it terminates. But you may not have saved your editing work yet. In that case, Qedit asks you "Discard changes?" and will not Exit/Purge unless you answer Yes:
qedit myfile
/visual
/exit
Discard your changes [no]:
/
This section describes features of Qedit/Open that interact with the LINUX environment.
LINUX utilities that invoke an external editor use the variable EDITOR to determine which editor and run-time options are invoked. The electronic mail tool elm is an example of a utility that uses an external editor to write all messages.
If you want to use Qedit as your standard editor, you need to set the EDITOR variable. We recommend using the -s option for application use.
BASH Shell:
$EDITOR="qedit -s";export EDITOR
When Qedit needs a disposable scratch file (e.g., for Text or Add), it creates a Qedit format file in /var/tmp by default (/usr/tmp is the default on older versions of LINUX) or the path name specified in the TMPDIR environment variable. The scratchfile name is qscr.xxxxxxxxx where "xxxxxxxxx" is a random string generated by the LINUX tempnam routine.
Keep in mind that Qedit works with absolute filenames and these names can not have more than 240 characters.
Because all LINUX files are permanent, Qedit must purge this scratch file when you exit Qedit. If you have made any changes, Qedit asks whether you want to discard the changes that you have made.
Qedit has two Hold files: Hold and Hold0. The first one is created using the Hold command.
Lines are written to the Hold0 file every time you move or copy with the Add command.
By default, these Hold files are created in /var/tmp (/usr/tmp is the default on older versions of LINUX) or the path name specified in the TMPDIR environment variable. The Hold files are called qholdxxxxxxxxx (explicit Hold) and qholdxxxxxxxxx.0 (implicit hold file) where "xxxxxxxxx" is a random string generated by the LINUX tempnam routine.
If you want to have these files in a different location, you can set the TMPDIR environment variable to the new path name.
TMPDIR=/home/user1/tmp
export TMPDIR
Keep in mind that Qedit works with absolute filenames and these names can not have more than 240 characters. So that you don't have to remember these names, you can refer to these files as Hold or Hold0 in Qedit commands. For example,
/hold 50/60 {save lines in the Hold file}
/open report.cob {switch files}
/aq last=hold {lines copied from the Hold file}
The value of TMPDIR can be a relative or absolute path. Internally, Qedit always uses the absolute path. It converts the relative path if needed.
You cannot use Qedit to look at files in your current directory called hold or hold0, unless you qualify them with the directory or a relative path name, as in ./hold.
The Hold files are removed when you exit Qedit.
You can execute shell commands by typing them at anywhere you can type a Qedit command. If Qedit determines that it is not one of its own commands, it assumes it's a shell command and tries to execute it as such. If the shell command matches an existing Qedit command, you must precede it by a colon (:) or an exclamation mark (!). Shell commands are executed by your default shell (the one configured in /etc/passwd for your user name).
If you want to enforce the use of the colon or exclamation mark prefix, you can enter Set Limits Colonreq ON.
Shell commands are executed by a child copy of your shell. Child shells cannot change environment variables in the parent's environment. To change the value of an environment variable, you must first exit Qedit.
The default Qedit/Open tab stops are every 8 characters. You can override this using Set Tabs Stop n (every 2 to 15 characters). If you Exit from Qedit with the tabs set to anything other than Set Tabs Stop 8, Qedit resets your terminal to the default tab stops.
When you Text or List a file with tab characters in it, Qedit/Open does not expand them to spaces. If you want to expand tabs into spaces when Texting a file, use the Expandtabs option:
/text abcwork,expandtabs
Most Linux environments have Control-D configured as the end-of-file character. If you use Robelle-style modify, you must reassign Control-D to a different control character.
stty eof “^E”
Another character you may want to have available in Set Mod Robelle is Control-V, which is split a line, in order to allow for that, you may need to use stty to change the lnext, so something other than Ctrl-V.
stty lnext “^K”
Some file names are hardcoded into Qedit. This section describes these file names for Qedit/Open.
This is an optional file that is designed to contain configuration commands. You cannot change this file name. Even if you move Qedit/Open to a different directory, Qedit/Open still looks for /opt/robelle/qeditmgr as the default configuration file.
In addition to the system wide /opt/robelle/qeditmgr, each user can have a personal (optional) configuration file. When you invoke Qedit/Open, it reads commands from the file .qeditmgr in your home directory.
Qedit looks for the files it needs in the /robelle directory. Normally, Qedit is installed in /opt/robelle. For example, the Qedit server expects to find its log files in a subdirectory called log/qedit. It would expect to find the error log file in
/opt/robelle/log/qedit/error.log
which is the default full path name of the error log. If you install Qedit in a directory other than /opt/robelle, Qedit should be able to determine the new location and adjust the path for its support files
If Qedit is unable to correctly determine its current location, it is going to revert back to /opt/robelle.
If you wish to use a specific path explicitly, you need to set the ROBELLE environment variable to the new directory. For example,
ROBELLE=/usr/apps/robelle
export ROBELLE
There are two limitations to the path name: the full path name of the file must be no more than 240 characters, and the path name to the /robelle directory must be no more than 219 characters. A slash mark (/) is optional at the end of your ROBELLE environment variable. To set up the log files in the new directory, you have to manually create the "log" or "help" subdirectory in the alternate search path.
So, in order to determine the location of support files, Qedit goes through the following:
· Uses the ROBELLE variable, if it exists.
· If the ROBELLE variable does not exist, Qedit tries to identify the location it is running from and, if successful, determines the location based on that information.
If the information from the previous steps is not available, Qedit assumes the files are in the /opt/robelle directory.
Qedit updates a variable, QEDCURWFILE, with the name of your current or last workfile. This gives you the ability to reference the current workfile easily from within a shell script without having to pass it in as a parameter.
Qcat is a filter program similar to cat and zcat. Qcat reads a set of Qedit files and prints the lines on standard output. Type man qcat for more information.
qcat QeditFile > TextFile
We have tried to make the MPE and LINUX versions of Qedit as compatible as possible. This section describes how Qedit/Open is different from Qedit/MPE.
Qedit/Open uses three forms of workfiles: original, Jumbo, and Wide-Jumbo. The Wide-Jumbo format is new and is used for most files on which you use the Text command. On LINUX, the original format is unable to save some information about your file (due to technical differences in how the Qedit workfiles are stored on MPE versus LINUX). Once you shut an original file, the following is lost:
· The name of the file from which you texted.
· The current line number.
· The ability to immediately reopen the file and "Undo" changes.
· The settings for Set Left and Set Right.
For these reasons, Wide-Jumbo workfiles will be the standard in Qedit/Open.
Qedit/Open does not allow substitution of the current file name into shell scripts and commands, because the asterisk (*) is an important substitution character in LINUX. For example,
/cc *
cannot compile your current file. Instead, it compiles all files in your current directory.
The following features do not work in Qedit/Open:
· Beginfile/Endfile commands.
· Hints are not available.
· Verify to a line printer.
· Any MPE-style command such as :Pause, :Run, etc.
· Proc command, except for Up and Down.
· I/O redirection of Qedit commands.
· Spell and Words commands.
· Out= option of the Listredo command.
· User Defined Commands and command files.
· The QEDITCOUNT variable
On Linux, files can contain NewLine (nl) characters at the end of each line. However, the NewLine characters are optional. Some files have them. Others don't.
Qedit/Open requires that lines be separated by a NewLine (NL) character. If that's not the case, Qedit/Open assumes the file does not contain anything. Thus, the Text command might display:
/Text longfile
'Language' is now DATA
0 lines in file
If you run into this problem, you have to find a way to insert these NewLine characters in appropriate places and break the file into manageable pieces.
Starting with version 5.3.13 of Qedit/Open, you can use the Length option of the Text command. This option allows you to specify the maximum size in bytes of each line. The file will be split in a number of same-size lines except the last one if the total size of the file is not evenly divisable by the specified length.
If the file contains Newline characters, these characters are processed as data. You should be very careful when editing such files. If you inadvertently remove one or more of these characters, other programs might have problems using the file again. Since Newline characters causes terminals to move to the next line, we recommend that you use the $Char or the $Hex option on List commands.
For example, to break a file into 80-byte lines, you should use:
/Text longfile,length 80
Another way to accomplish this is by using the fold command.
fold -w 80 longfile > shortfile
In this example, the file longfile is broken down into fixed-length lines, each line containing a maximum of 80 bytes. The result is written to a new file called shortfile. It is then possible to edit the new file using Qedit/Open.
Once you have made all the necessary changes, you can put the short lines back together by removing the NewLine characters. You can use the UNIX awk to perform this operation.
awk -v ORS="" '{ print $0 }' shortfile > longfile
The Output Record Separator (ORS) argument is used to specify the character to be inserted between lines. In this case, you don't specify any.
Because of a limitation in awk, you cannot assemble lines with more than 3,071 bytes. So, you have to remember not to exceed this maximum in the fold command.
Another option is to use the UNIX tr command and remove all Newline characters.
tr -d "/n" < shortfile > longfile
Character strings can be used of line numbers to qualify lines on most commands. In its simplest form, a command can have a single string using all the search window defaults.
/List "enhancement"
The search string can be further qualified using temporary window settings as in:
/List "enhancement" (Upshift 20/50)
This example searches for the word enhancement regardless of the case used in columns 20 to 50.
Qedit allows up to 10 search strings on a single command. Individual strings are separated from each other with the OR keyword. Each string can have its own temporary window.
/List "enhancement" (U 20/50) or "bug" or "customer" (1/30)
The search range can be different depending on the command it is used on. For example, a List command searches all the lines in the file by default while a Find command starts from the current line. The search range can be specified on individual commands using a rangelist. A rangelist is often specified using line numbers (absolute or relative), special keywords (First, Last, All) or characters (@, *, [, ]). To define a block of lines, the user can enter 2 line numbers separated a slash "/" e.g. 1/6.
It is also possible to define a block of lines using a string range. This syntax allows the use of strings to define the start and end of the range. A string range can also be combined with a numeric line range to further define the block. Here are some examples:
/List "start-proc" / "end-proc"
/Change "a" "b" "start-proc" / "end-proc"
/Delete "start-proc" / "end-proc" 20/100
The List command above finds the first occurrence of start-proc in the file and uses it as the range start location. It then finds the first occurrence of end-proc starting from the start location. It uses that line as the range end location. Finally, it lists all the lines between the 2 locations. By default, List starts at the beginning of the file.
The Change command above replaces all occurrences of the letter a with a b in the lines between (and including) start-proc and end-proc. By default, Change starts at the current line.
The Delete command above removes all the lines between (and including) start-proc and end-proc found in lines 20 to 100. By default, Delete starts at the beginning of the file.
A string range does not behave like a rangelist e.g. 1/20 in all cases. For example, the first statement is not a valid construct with the second statement is.
/Delete "bug" "start-proc"/"end-proc"
Error: Linenum
/Delete "bug" 10/30
You can use the Find command and the ZZ marker to work around the problem. If you enter a simple strings on a Find command, Qedit stops at the first string occurrence and sets the current line. You can then perform any operation on that line or use it as a starting point. If you specify a line range, the Find command sets the ZZ marker to the block of lines. You then use the ZZ marker on subsequent commands.
/F "start-proc" first
5 Start-Procedure.
(1)^
/F "start-proc"/"end-proc" first
Lines 5/11 saved in ZZ
/Delete "bug" zz
8 _bug-display-section.
1 line Deleted!
Qedit/ Linux operates in Line mode on Linux. We are investigating Screen mode for the Linux version. We are interested in getting information about the environments you would be using Qedit in.
Here we describe the Qedit commands in alphabetic order. For each command, we show both the longest and the shortest name that Qedit can recognize, as in Add [A]. Highlighted terms (e.g., linenum) and jargon words (e.g., "workfile") are defined in the "Glossary".
Here are general guidelines that apply to using the Qedit commands.
Each Qedit command has a name such as List that you can abbreviate to any leading subset. Thus, L means List. Some commands require more than one letter: GARbage, DEStroy, RENumber, SHut. You may append option letters to the command: Q, T, or J. Q means "quiet", T means "template", and J means various things, depending on the command.
list all {fully spelled out}
l @ {maximal abbreviation}
lq {list quietly}
listqt {list quietly, with template}
lqjt {list quiet, jumping, with template}
list $ {most recent external file name}
s dec on {Set Decimal command}
sh {Shut command}
You can enter the commands in uppercase or lowercase. Shell commands such as ls and cd can only be in lowercase. These commands are identical:
LIST ALL {uppercase}
list all {lowercase}
You can enter several commands on a single line, if you separate them with semicolons. The maximum command line is 256 characters, and \ is not supported for continuation. If you want to have an LINUX command or a calculator command in the stack, you should enclose it in parentheses. This prevents Qedit from passing the rest of the line as parameters. For example,
List 5;!find . -name testfile -exec cat {} ; {fails}
List 5;(!find . -name testfile -exec cat {} ;) {works}
If the syntax requires semicolons and parentheses, you have to put the problematic command in a shell script and use it in the command list instead.
Any error causes Qedit to flush the remaining commands in the line.
list 505;add *-1 {list line 505; add just before it}
shut;who
When combining Qedit commands, be certain to use the same quote character in all the commands.
Wrong:
/c7/7"DISPLAY";c\.\\
Right:
/c7/7"DISPLAY";c".""
You may annotate Qedit commands by putting comment text in curly braces at the end of the line:
keep sample,yes {update disc file}
Such comments are recognized at the "/" prompt, in usefiles, Next? prompt and List's More? prompt.
You can stop most Line mode functions by pressing the Control-Y key. For example, to stop an inadvertent List ALL, use Control-Y. To stop the Add, Modify, or Replace commands, use either Control-Y or two slashes (//).
Some commands have no alphabetic name. In Line mode, pressing only Return means display the next line and a backslash (\) means display the previous line, $ means enable Memory Lock and $- means disable Memory Lock. In either mode, ? means Help, any line number means go to that line, a string means display the next line with that string, and "^" means search backwards for a string:
55 |
find and display line 55 or higher |
FIRST |
find and display first line |
;;;; |
display the next 5 lines |
\ |
display the previous line |
-5 |
move current line back 5 lines |
"string" |
display next line with string |
^"string" |
display previous line with string |
$ |
turn on memory lock at this line |
$- |
turn off memory lock |
Qedit accepts most LINUX commands and scripts. If the shell command matches an existing Qedit command, you must precede it with a colon (:) or an exclamation (!). See Running Qedit on LINUX for more details.
Any command that begins with an equal sign (=) is treated as a calculator expression. This feature can be used to compute temporary values and do conversions from one number base to another.
=64,O
Result= %000100
Adds lines into the workfile. There are five varieties of Add that cover all the ways you can add lines into a Qedit workfile:
NEW |
Add new lines to your workfile from Stdin. |
STRING |
Add a new line from the command prompt. |
COPY |
Copy lines from one place to another. |
MOVE |
Move lines from one place to another. |
FILE |
Bring lines in from an external file. |
Add some new lines from the terminal keyboard. Insert them at a given line number or after it.
ADD [ linenum ]
(Q=no linenums, J=justified, T=template)
(Default: linenum = *)
The linenum parameter specifies where to add new lines and also determines the increment between new lines. If linenum is 9.1, lines will be incremented by 0.1; if 9.01, then 0.01. If linenum already exists, Qedit increments it and begins adding after the existing line. If linenum is 0, Qedit adds new lines before the first existing line in the file. If you don't say which linenum, Add inserts the lines after the current position (*). (See Miscellaneous Points below.)
Examples
/add 5 {add new lines after line 5}
5.1 line a {Qedit prompts with line number}
5.2 line b {you enter line of text and Return}
5.3 // {you enter // or Control-Y to stop}
/aq {add after * line; no prompt}
This is new text
// {end the Add command}
Temporary Workfile
If you do not have a named workfile Open when you Add, Qedit automatically builds a temporary workfile for you. This file has a random file name and is created in /var/tmp by default. If you want to have temporary files in a different directory, enter the new path name in the TMPDIR environment variable.
TMPDIR=/home/user1/tmp
export TMPDIR
Keep in mind that Qedit works with absolute filenames and these names can not have more than 240 characters.
If you make any changes to the file (e.g., by adding lines), Qedit will ask if you want to save your changes when you exit.
Using the Tab Key
By default, Qedit defines tabs every 8 columns across the line (every 10 for Qedit/MPE). You can override these default tab stops using Set Tabs Stop n (every 2 to 15 characters) or Set Tabs 5 10 22 28 ... for completely custom tab stops. When you press the tab key as you Add lines, Qedit correctly inserts spaces in your lines and skip to the correct column on your screen (assuming you are using an HP terminal).
Overflowing Lines or Line Numbers
The Add command continues prompting until you press Control-Y, or you type "//" at the end of a line, or you run out of line numbers. When you exhaust the line numbers possible between two lines, Qedit prints "Error: Already". You can continue by doing a range Renumber on the area where you wish to add more lines. Thus, if your last line added was 4.999, use Renum 4/5 to spread out the lines between 4 and 5.
You can configure Qedit to automatically renumber part of the file so that you do not have to renumber it manually. See the Set Visual Renum option.
Line Wraparound
If you enter a line that is too long, Qedit divides it into several lines. Set Wraparound ON divides lines on "word" boundaries only. Any words that will not fit on the current line are moved to the next line. If only a small number of words are moved to the next line, Qedit prompts you to complete the line. To end the Add when this happens, press Return before typing "//". If you are editing FORTRAN source code, Qedit generates a valid continuation line for you.
Automatically Indenting Lines
AJ for justified is a special option to indent new lines. The linenum you specify must be an existing line. You enter new lines beneath it. Qedit will then indent the new lines by exactly the same number of spaces as the existing line. You can shift the indentation left by typing {'s at the start of a line, or shift it right with }'s. To redefine the { and } characters, use Set Zip.
Modifying a Line During Add
When you know you made a typo, and prefer to fix it now instead of going on, the auto-modify character will help you. Enter the command Set Zip []@{}#, or better yet, put it in your Qeditmgr configuration file. The # character (or other special character of your choice) is called the auto-modify character. It allows you to modify the line you are currently entering. Type "#" at the end of the line, and Qedit redisplays the line for you to modify. When you are done with the Modify, you press Return to continue adding new lines.
Miscellaneous Points to Note
If you have Set Left/Right margins, the new lines added will have spaces to the left and right of the margins. That is, the line you enter will be left-justified within the current margins of the workfile.
The maximum default increment between new lines is 1.0 (or 0.1 for standard COBOL files). You can change this default with Set Increment.