home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Micro R&D 1
/
MicroRD-CD-ROM-Vol1-1994.iso
/
os20
/
cli
/
hacks204.lha
/
ReadMe.doc
< prev
next >
Wrap
Text File
|
1991-11-28
|
8KB
|
242 lines
Here are a few commands that did not make it into 2.04; however, I've
gotten the go-ahead to distribute them in this fashion; It's possible
that future versions of the OS will contain updates of these commands.
It's also possible that it won't.
These commands are designed for 2.04. It is possible that future
revisions of the OS will require future revisions of these commands.
(This is why I consider them hacks)
Anyway, I've been using them for about a year; now that everyone
can get 2.04 (and now that I've cleaned the commands up) its time to give you
the opportunity too.
Any bugs you find should be reported directly to me, as well as to Commodore,
for they should not be currently considered Commodore supported. I will
probably fix the bugs I hear about, though.
have fun,
andy finkel
-------------------------------------------------------------------
History
Template: LINES/N,START/N,LOAD/K,SAVE/K,SIZE/K/N,RUN/S,CLEAR/S,SHOW/S,NONUM/S
The HISTORY command is used to control the 2.04 console handler history features.
This command allows you to review, load, save, clear, and change the size of the
history buffer. In addition, the command allows you to re-execute portions of the
history buffer without using the cursor keys.
The history command can be used to display the current history buffer just
by using the command
history
To see the last N entries in the history buffer, you also the number, eg
history 10 will show you the last 10 entries. (You can also say
history LINES 10).
To see N entries in the history buffer, starting with entry X, you would specify
both numbers, eg
history 8 20
which will display 20 history lines starting with history entry # 8.
(you can also say HISTORY LINES 8 START 20)
On the left margin of the history listing is the command histry number. To supress
those numbers, use the NONUM keyword. (this is often useful when redirecting the
output of the history cmmand into a file or a pipe.
The LOAD keyword allows you to preload the history buffer, up to the limits of the
current size of the history buffer.
SAVE saves the current history buffer to a file. NOTE: partial saves are possible,
following the same rules as partial listings of the history buffer.
The CLEAR keyword erases the contents of the history buffer. It may be used by
itself, or with one of the other keywords.
The SIZE keyword allows you to change the size of the history buffer of the
current console-handler. You can change the size in 1K increments. The initial
history buffer size is 2K.
The RUN keyword allows you to run one or more commands in the history buffer.
history run 5
will run command 5.
history run 5 3
will run 3 commands, starting with the 5th entry in the history buffer.
a useful alias is
alias ! history lines 1 run start
which kind of gives that Unix csh effect.
The SHOW option is there as a default; it can be combined with other options,
however.
-------------------------------------------------------------------
Pipe
Template: COMMAND/F
The PIPE command is like the RUN command, with several differences. The PIPE
command is designed to run several commands at a time, redirecting the output of
one into the input of the next.
The PIPE command can also be used to run multiple commands; but its main use is
for the piping.
Commands are separated by the vertical bar character (|) for a pipe operation, ie
pipe list sys: | more
NOTE: use of redirection in commands will prevent the proper transfer of output
from one command to the next.
All the commands in the PIPE command line are run asynchronously, except
the last one; synchronization is provided by the blocking pipes provided
by the queue-handler.
The pipe command works best with commands that will look to standard input for
input, and send output to standard output. Unfortunately, many Amiga programs do
not do this; instead they demand an input file (and sometimes even an output file)
Rather than just not work with those commands, the PIPE command supplies two fake
file handles, similar to the NIL: file handle, called IN: and OUT:, representing
the data from the preceeding command and the output to the next command. Thus it
becomes possible to use commands like:
pipe list | sort in: out: | more
or
pipe list #?.c lformat="rlog %n" | execute in:
It is often convienent to define an alias for commands that you use
frequently with pipes that require in: and out:, ie
alias psort sort in: out:
will allow you to do things like:
pipe list lformat=%n | psort | more
You can even do things like:
alias plist pipe list lformat=%n | psort | more
Now you have an alias that does a sorted list through the more command.
To use The PIPE command for multiple commands, the individual commands are
seperated by the \ rather than the |. Output is not passed from one stage
to the next. In the current implementation, each command is run in
a seperate subshell; this is subject to change in a future revision.
The PIPE command allows you to change the pipe (and multiple command)
characters. PIPE looks at the shell variables __pchar and __mchar
(note the 2 underscores) for pipe character and multiple character.
You can use any one or two character combination, ie
set __pchar ||
will set your pipe character(s) to two vertical bars.
Pipe is best used as a resident command.
Note: If you put a RUN in a PIPE command line you probably won't get
quite what you expect, as all the commands are already being
run in the background.
If you control-C out of a PIPE operation, (or if there is some other
problem like a mistyped command) you will see the message "broken pipe",
and the pipe will drain; if the commands have produced a lot of output,
this may take a few seconds, as the current implementation of the queue-handler
does not support a 'flush pipe' operation.
Also, only the last command in the pipe receives the control-C.
(Originally, pipe sent a control-C to every command in the pipe; some
commands got upset) If you need to, you can find the other commands
by using the status command, and can issue them a BREAK manually.
-------------------------------------------------------------------
Recorder
Template: TO=ON,PROCESS/K/N,APPEND/S,OFF/S
The Recorder command is used to capture all the input and output in a particular
shell and save it to a file.
To use the recorder, merely type its name, ie
recorder
will activate the recorder, sending its output to the default file called
"recorder.output"
If you wanted to use a different file name, you could have said:
recorder ram:work.in.progress
And the output would have been send to the file ram:work.in.progress
To stop the recorder, the OFF option is used, ie
recorder OFF
This must be issued in the same shell that invoked the recorder.
To append new information to an existing file, the APPEND keyword is used, ie
recorder ram:work.in.progress append
will add new information to the already existing file. This command
can be issued after a recorder OFF command; In this way you can start
and stop the recorder at will.
Note: The recorder process can also be stopped by sending it a break
signal. This would be required to properly close the recorder
output file if you inadvertently close the shell while the
recorder is running. In that case, the shelll window would not
close until you found the recorder process by using the STATUS
command from another shell, and used the BREAK command to
send the recorder process a control-C.
The Process keyword is used internally by recorder.
Recorder should not be RUN, as it attaches to the current process, so is
generally not useful in its own short-lived process.
Recorder is based on ideas from Phillip Lindsey and David Cervone.