home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fish 'n' More 2
/
fishmore-publicdomainlibraryvol.ii1991xetec.iso
/
disks
/
disk426.lzh
/
Conman
/
Extras.doc
< prev
next >
Wrap
Text File
|
1991-01-02
|
4KB
|
88 lines
This file describes the auxiliary commands History, Push, Queue, and
Dropbuf supplied with Conman.
-- History --
History is a command utility to save, load, or display the history buffer.
It is useful for saving and then preloading a set of commands for working
on a particular project, or just to review your current command history.
History works only from a CLI or other shell and requires version 1.1 or
later of ConMan.
Usage.
The usage template for history looks like
history [>savefile] [inputfile]
If you don't specify any options, the command displays the current buffer
on the standard output stream. You can redirect this output into a file
to save it (or perhaps edit it).
If you specify a filename argument after the command, History will load
the contents of that file into the history buffer. The new lines are
loaded just as though they had been typed in. You can use the CTRL-B key
to clear the buffer first if you don't want to keep the current commands.
The lines to be loaded into the history buffer should have been obtained
by capturing a previous session. If you try something silly like loading
an executable file into the buffer, nothing will break, but you'll end
up with a lot of funny-looking characters in the command history.
Errors.
History checks to be sure that you've run it from a command shell that
uses ConMan, since the history is maintained by ConMan. If you try it
from another environment, it reports "Not a ConMan console window" and
exits.
-- Push, Queue, and Dropbuf --
ConMan provides special capabilities that allow an input stream to be
used as a temporary "scratchpad" to store a series of data lines. These
lines can be "stacked" (last in, first out) or "queued" (first in,
first out) to be read at a later time. These special capabilities are
available through the command utilities Push, Queue, and Dropbuf. Here's
what they do:
Push takes its command line and "stacks" it in the input stream. Stacked
lines always go the the head of the internal buffer, and are then available
for the next program (or the CLI) that reads from the stream. For example,
entering "push echo hi" would result in
1> push echo hi
1> hi
1>
The command line can be surrounded by double-quotes to prevent the CLI
from breaking it; the quotes are stripped off before the line is actually
stacked. Push is useful within an "execute" script to allow a series of
responses to be prepared for a program. For example, suppose that the
program "myprog" expects three lines of input. Then the following script
could be used to launch the program:
; Launch "myprog" with prepared data
push data line 3
push data line 2
push data line 1
df1:c/myprog -t
Note that the command lines are stacked in reverse order (well, in normal
order if you're a Forth programmer).
The Queue command behaves just like the Push command, except that it
places the data in "first in, first out" order. New data is placed behind
all previously queued (or stacked) data. The choice of whether to use
PUSH or QUEUE is usually just a matter of convenience, unless the data is
available in a particular order that constrains the decision.
Data lines entered by Push or Queue are never displayed on the console,
and are always ahead of any data received through the input stream.
Sometimes it may be necessary to delete or purge previously stacked data.
For example, if a program aborted after reading only part of its prepared
input stream, it would be confusing (or dangerous!) for the stacked data
to be read from the command stream. The Dropbuf command is provided to
"drop" (delete) all stacked or queued data, without perturbing any of the
lines received through the input stream.
Two brief demonstration scripts, "pushdemo" and "dropdemo", have been
included as examples. Type them out and then try "execute pushdemo".