home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
robot-pd
/
12400.ZIP
/
12400B.DSK
/
manual02.txt
< prev
next >
Wrap
Text File
|
1998-04-30
|
13KB
|
427 lines
C H A P T E R T W O
Command Dictionary
2.1 Shell Phraseology
<directory path>
This is a sequence of characters describing the location
of a directory to the Shell. There are three methods that
the Shell recognises, which were described in chapter one
of this manual.
<file path>
A file path is a directory path with a file name specified
after the directory path. The file name is appended to the
directory path and separated by a single slash ('/'), but
no spaces.
<selector>
Some commands can operate in different ways. Such commands
allow the user to tailor their operation by selecting
options. These options are invoked by the use of
"selectors". In general these are a sequence of characters
prefixed by "&". Details are given for each command where
such selectors exist.
[RETURN] indicates that the key marked RETURN or ENTER
should be pressed.
2.2 Internal Commands
Internal commands are commands which exist as part of the
main operating system code. As such, they do not need to
be loaded from the disc, and hence execute almost
immediately. Another advantage is that the commands can be
executed as subroutines to other commands, or from within
transient programs such as text editors. They are usually
very common or useful routines.
2.2.1 The CD command
Description :Change Directory
Format :CD <directory path>
Changes the position (or location) of the working
directory within the tree structure. The working directory
is used for specifying relative path names. A good habit
to get into is creating a directory for every topic the
computer is used for. When dealing with that topic, use CD
to move into the related directory.
If the <directory path> is not given, the user will be
returned to their home directory.
CD can be abbreviated by simply entering the directory
path followed by a colon:-
1>CD /COM --> 1>/COM:
Example:1>CD [RETURN]
This makes your home directory the current directory. This
places you in the same position as when you first started
the session.
2.2.2 The LF command
Description :List Files
Format :LF [<directory path>]
Lists the contents of the given directory, or the working
directory if no directory path is given. The files are
listed in the following format:-
<Directory path>
DRIVE {<A:><B:>} USER <1 .. 15>
[++<<File name><size>>]
[++<subdirectory>]
Example:1>LF /COM
Lists the contents of the COMmand directory. These are the
system program files for external commands.
2.2.3 The PWD Command
Description :Print Working Directory.
Format :PWD
Prints the absolute path to the working directory. This
command can't be abbreviated (see ALIAS).
2.2.4 The CAT command
Description :ConCATenate.
Format :CAT ++<[<selector>] <file path>>
Outputs the contents of the given files to the VDU. The
listing will be paused after a window full has been
displayed. Pressing [SPACE] will enable the listing to
continue. If several files are specified, there will be no
break between the display of each file in the sequence.
As mentioned above, CAT will usually operate even if it is
sending the results to a screen window of smaller size. If
paging does not appear to be correct, however, ^S can be
pressed to pause the display, and ^Q to restart it.
Note that while CAT will display the contents of the
object file produced by the COMP program (see later) the
contents will not be displayed correctly. This is because
such files are stored as true ASCII-rather than the
TEXT format used by Centrox.
If the selector "A" is given then the following file will
be treated as a true ASCII file. This allows object code
produced by COMP to be listed. Note that the "A" selector
only holds for one file-it must be invoked before EVERY
file path that requires it if several file paths are
given.
Note that due to memory restrictions, CAT does NOT
translate the backward single quote character into a
double quote character and hence text files may look odd.
Example:1>CAT -/login.usr
This lists the contents of your login file. The commands
that are shown by this command will be executed as soon as
Centrox is able, and before you type your first command.
:2>CAT &A ascii1.dat text.dat &A ascii2.dat
Lists an ASCII file, followed by a text file and finishes
by listing another ASCII file.
2.2.5 The DATE Command
Format :Date [<date><month><year>]
Takes the given date - or the current date if none was
given - and works out the day that the date occurred on.
The result is then output in the following form:-
<day>, <month> <date> <year>
Note that the date is given to the routine as a number
whilst the month may be given numerically or literally. In
the resulting output, the day is given literally, as is
the month. The year, of course, is always input-and
output-numerically.
The system used to calculate the date takes into account
the various "modifications" made to the calendar. It works
out the date according to the Protestant version of the
Julian calendar.
The routine used by the Shell was first published in
Amstrad Action. The source code from which the routine was
derived was written by Gary Nugent and published in the
July '87 issue of Amstrad Action.
Note that the Shell will ask the user to set the correct
date when signing on, failure to set the date correctly
will not "upset" the system but since an illegal date
can't be entered, there is little point in not entering
the date correctly-the facility was provided for the user,
not the machine.
Example:1>DATE 28 2 1967
2>DATE 28 February 1967
3>D. 28 F. 1967
These all show the same information..the day that I was
born, Tuesday, February the 28th 1967. Note the
abbreviations employed in the third example.
Error Messages
"Illegal date"-The date you supplied was not legal.
"No such date"-The date you supplied is legal, but was
removed when the protestants corrected the calendar.
"The date is:<date>"-Standard reply.
2.2.6 The TIME Command
Format :TIME
Displays the current time on the VDU. The time is
displayed in the following format:-
<hour>:<minute>
Note that the Shell will request the user to set the time
while signing on.
Note that the Shell will "ring" the chimes on the hour
using the chime bell (see ECHO). As with the DATE command,
incorrect setting of the time is not a problem, however an
illegal time will be rejected.
If the Shell is left in direct command mode for more than
about 2 hours, its internal clock will lose time. If left
in direct mode for any length of time, there will also be
a slight delay after RETURN is pressed, while the clock is
updated.
This command can't be abbreviated (see ALIAS).
Error Messages
"The time is:<time>"-Standard report.
2.2.7 The DO Command
Format :DO [{<number><string>}]
The Shell remembers the last twenty commands, and allows
the user to recall them to save time. The DO command is
the main mechanism for command line recall. It works in
two ways:-
1.DO <number>
The Shell numbers each command line as it is entered. The
current number will usually be displayed when the Shell is
waiting for some input. Using DO as above will recall the
command line that had the given number. See ECHO.
2.DO <string>
Will search through the stored commands looking for a
command line that begins with the given string. Note that
the search begins at the most recently typed command line.
In either case, note that a command line may consist of
several commands, separated by semi-colons. Also note that
only those commands entered at the Shell prompt will be
stored. Programs that allow access to the Shell routines
are unlikely to update the list, though they may well be
allowed to recall command lines.
If no argument is passed to the command, a list of the
currently stored commands will be displayed in the
following format:-
<command.number> <command.line>
Error Messages
"Command lost"-The Shell can't find the requested command.
2.2.8 The ALIAS Command
Format :ALIAS [<word>[/<phrase>]]
The Shell can be programmed to substitute the first WORD
in a statement for a PHRASE. The phrase may both contain
any number of characters. The shell removes the word from
the statement and replaces it with the phrase.
If only <word> is given, the Shell will delete the
instruction for replacing occurrences of <word>.
If no phrases are given, the Shell will list the currently
defined instructions.
To allow multiple commands to be substituted, the
semicolon will need to be inhibited. This can be done by
typing a pair of semicolons:-
ALIAS ebl/echo Editing Login file;;ctx -/login.usr
Several internal commands are created using ALIAS in
conjunction with ECHO (see later). These commands are:-
TIME:ALIAS time/ECHO The time is:!t!c0A!c0d
PWD:ALIAS pwd/The working directory is:!w!c0A!c0D
Also MODE & CLS, which are covered later. Creating the
commands this way makes more efficient use of memory.
Unfortunately it does mean that these commands can't be
abbreviated.
It can save typing effort if you create your own commands
to move into often used directories, eg:-
ALIAS ebl/ECHO Moving into source directory;;cd -/ebl
Note that when ALIAS is used in a login file, any double
semicolons should be replaced by a single semicolon, since
the login interpreter does not allow multiple command
statements, and hence does not recognise the delimiting
abilities of the semicolon.
ALIAS does not distinguish between upper and lower case
letters.
Error Messages
"No room"-No more ALIASes can be defined.
2.2.9 The ECHO Command
Format :ECHO <CXtring>
Passes (reads and evaluates) the given "CXtring" and
outputs the result on the VDU. This command is very
powerful as the CXtring can contain meta characters, which
are prefixed by "!" ("Pling").
Echo has several uses. Firstly, it can be used in
conjunction with a LOGIN file to display sign on messages,
it is also used to display the time and can be used in
conjunction with ALIASed commands to let the user know
what a particular ALIAS is doing.
The Meta characters allowed are:-
"w" : Output working directory.
"!" : Outputs a `!'.
"d" : Outputs the current date.
"t" : Outputs the current time.
"u" : Outputs the current user's name.
"c"<00.FF> : Outputs the character whose ASCII code is
given in hexadecimal. The sequence !c0A!c0D will start a
new line on the screen.
"$"<0..99><char.> Outputs the given number of the given
character.
"n" : Outputs the current prompt number - See DO.
"g" : "Ring" the chime bell. This bell is also rung on the
hour to sound the chimes.
2.2.10 The PROMPT Command
Format :PROMPT <CXtring>
The Shell can be programmed to output a prompt message
whenever it is expecting a command line. The PROMPT
command allows the user to define this message.
The message is given as a CXtring, which is defined in the
entry on ECHO. If no CXtring is given, the prompt will not
appear.
2.2.11 The CLS Command
Format :CLS
This command clears the screen. CLS is defined with the
ALIAS mechanism:-
ALIAS cls/ECHO !c0C
This command can't be abbreviated (see ALIAS).
2.2.12 The MODE Command
Format :MODE <number>
Again, this is defined using ALIAS, using a clever trick:-
ALIAS mode/ECHO !c04!c
This command can't be abbreviated (see ALIAS).
Note that the construct !c <digit> is quite valid, and
hence the above command works.
2.2.13 The ENLARGE Command
Format :ENLARGE [<command statement>]
This command toggles the Shell residency between Transient
and Permanent (the default). When the Shell is transient,
it is usually only present when it is needed.
The advantage gained from Transient mode is that you have
an extra 7K of memory available. The disadvantage is that
Shell commands are no longer accessible from within TPs
(such as the text editor), and returning to the Shell
prompt after completion of an external command takes a few
seconds longer.
If the <command statement> is given, the Shell will only
be removed for the duration of the given command.
2.2.14 PATH
Syntax :PATH ++<Directory path>
Lists the directories in which the Shell is to look when
an external command is issued if the external command is
not found in one of these directories, then the error
message "<name> ?" is issued. Note the the path "/COM" is
always searched, and that the Shell defaults to also
searching "." (the current directory).
A P T E R T W OΩ
╔Command DictionaryΘ
╩2.1 Shell PhraseologyΩ
╔<director