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 >
Text File  |  1998-04-30  |  13KB  |  427 lines

  1.  
  2.                  C H A P T E R    T W O
  3.  
  4.                    Command Dictionary
  5.  
  6. 2.1 Shell Phraseology
  7.  
  8. <directory path>
  9.  
  10. This is a sequence of characters describing  the  location
  11. of a directory to the Shell. There are three methods  that
  12. the Shell recognises, which were described in chapter  one
  13. of this manual.
  14.  
  15. <file path>
  16.  
  17. A file path is a directory path with a file name specified
  18. after the directory path. The file name is appended to the
  19. directory path and separated by a single slash ('/'),  but
  20. no spaces.
  21.  
  22. <selector>
  23.  
  24. Some commands can operate in different ways. Such commands
  25. allow the user to  tailor  their  operation  by  selecting
  26. options.  These  options  are  invoked  by  the   use   of
  27. "selectors". In general these are a sequence of characters
  28. prefixed by "&". Details are given for each command  where
  29. such selectors exist.
  30.  
  31. [RETURN] indicates that the key  marked  RETURN  or  ENTER
  32. should be pressed.
  33.  
  34. 2.2 Internal Commands
  35.  
  36. Internal commands are commands which exist as part of  the
  37. main operating system code. As such, they do not  need  to
  38. be  loaded  from  the  disc,  and  hence  execute   almost
  39. immediately. Another advantage is that the commands can be
  40. executed as subroutines to other commands, or from  within
  41. transient programs such as text editors. They are  usually
  42. very common or useful routines.
  43.  
  44.  
  45. 2.2.1 The CD command
  46.  
  47. Description :Change Directory
  48.  
  49. Format :CD <directory path>
  50.  
  51. Changes  the  position  (or  location)  of   the   working
  52. directory within the tree structure. The working directory
  53. is used for specifying relative path names. A  good  habit
  54. to get into is creating a directory for  every  topic  the
  55. computer is used for. When dealing with that topic, use CD
  56. to move into the related directory.
  57.  
  58. If the <directory path> is not given,  the  user  will  be
  59. returned to their home directory.
  60.  
  61. CD can be abbreviated by  simply  entering  the  directory
  62. path followed by a colon:-
  63.  
  64. 1>CD /COM --> 1>/COM:
  65.  
  66. Example:1>CD [RETURN]
  67. This makes your home directory the current directory. This
  68. places you in the same position as when you first  started
  69. the session.
  70.  
  71.  
  72. 2.2.2 The LF command
  73.  
  74. Description :List Files
  75.  
  76. Format :LF [<directory path>]
  77.  
  78. Lists the contents of the given directory, or the  working
  79. directory if no directory path is  given.  The  files  are
  80. listed in the following format:-
  81.  
  82. <Directory path>
  83.  
  84. DRIVE {<A:><B:>} USER <1 .. 15>
  85.  
  86. [++<<File name><size>>]
  87.  
  88. [++<subdirectory>]
  89.  
  90. Example:1>LF /COM
  91. Lists the contents of the COMmand directory. These are  the
  92. system program files for external commands.
  93.  
  94.  
  95. 2.2.3 The PWD Command
  96.  
  97. Description :Print Working Directory.
  98.  
  99. Format :PWD
  100.  
  101. Prints the absolute path to the  working  directory.  This
  102. command can't be abbreviated (see ALIAS).
  103.  
  104.  
  105. 2.2.4 The CAT command
  106.  
  107. Description :ConCATenate.
  108.  
  109. Format :CAT ++<[<selector>] <file path>>
  110.  
  111. Outputs the contents of the given files to  the  VDU.  The
  112. listing will be  paused  after  a  window  full  has  been
  113. displayed. Pressing [SPACE] will  enable  the  listing  to
  114. continue. If several files are specified, there will be no
  115. break between the display of each file in the sequence.
  116.  
  117. As mentioned above, CAT will usually operate even if it is
  118. sending the results to a screen window of smaller size. If
  119. paging does not appear to be correct, however, ^S  can  be
  120. pressed to pause the display, and ^Q to restart it.
  121.  
  122. Note that while CAT  will  display  the  contents  of  the
  123. object file produced by the COMP program (see  later)  the
  124. contents will not be displayed correctly. This is  because
  125. such files  are  stored  as  true  ASCII-rather  than  the
  126. TEXT format used by Centrox.
  127.  
  128. If the selector "A" is given then the following file  will
  129. be treated as a true ASCII file. This allows  object  code
  130. produced by COMP to be listed. Note that the "A"  selector
  131. only holds for one file-it must be  invoked  before  EVERY
  132. file path that requires  it  if  several  file  paths  are
  133. given.
  134.  
  135. Note  that  due  to  memory  restrictions,  CAT  does  NOT
  136. translate the  backward  single  quote  character  into  a
  137. double quote character and hence text files may look odd.
  138.  
  139. Example:1>CAT -/login.usr
  140. This lists the contents of your login file.  The  commands
  141. that are shown by this command will be executed as soon as
  142. Centrox is able, and before you type your first command.
  143.  
  144.          :2>CAT &A ascii1.dat text.dat &A ascii2.dat
  145. Lists an ASCII file, followed by a text file and  finishes
  146. by listing another ASCII file.
  147.  
  148.  
  149. 2.2.5 The DATE Command
  150.  
  151. Format :Date [<date><month><year>]
  152.  
  153. Takes the given date - or the current  date  if  none  was
  154. given - and works out the day that the date  occurred  on.
  155. The result is then output in the following form:-
  156.  
  157.               <day>, <month> <date> <year>
  158.  
  159. Note that the date is given to the  routine  as  a  number
  160. whilst the month may be given numerically or literally. In
  161. the resulting output, the day is given  literally,  as  is
  162. the month.  The  year,  of  course,  is  always  input-and
  163. output-numerically.
  164.  
  165. The system used to calculate the date takes  into  account
  166. the various "modifications" made to the calendar. It works
  167. out the date according to the Protestant  version  of  the
  168. Julian calendar.
  169.  
  170. The routine used by  the  Shell  was  first  published  in
  171. Amstrad Action. The source code from which the routine was
  172. derived was written by Gary Nugent and  published  in  the
  173. July '87 issue of Amstrad Action.
  174.  
  175. Note that the Shell will ask the user to set  the  correct
  176. date when signing on, failure to set  the  date  correctly
  177. will not "upset" the system  but  since  an  illegal  date
  178. can't be entered, there is little point  in  not  entering
  179. the date correctly-the facility was provided for the user,
  180. not the machine.
  181.  
  182. Example:1>DATE 28 2 1967
  183.           2>DATE 28 February 1967
  184.           3>D. 28 F. 1967
  185. These all show the same information..the day  that  I  was
  186. born,  Tuesday,  February  the   28th   1967.   Note   the
  187. abbreviations employed in the third example.
  188.  
  189. Error Messages
  190.  
  191. "Illegal date"-The date you supplied was not legal.
  192.  
  193. "No such date"-The date you supplied  is  legal,  but  was
  194. removed when the protestants corrected the calendar.
  195.  
  196. "The date is:<date>"-Standard reply.
  197.  
  198.  
  199. 2.2.6 The TIME Command
  200.  
  201. Format :TIME
  202.  
  203. Displays  the  current  time  on  the  VDU.  The  time  is
  204. displayed in the following format:-
  205.  
  206.                      <hour>:<minute>
  207.  
  208. Note that the Shell will request the user to set the  time
  209. while signing on.
  210.  
  211. Note that the Shell will "ring" the  chimes  on  the  hour
  212. using the chime bell (see ECHO). As with the DATE command,
  213. incorrect setting of the time is not a problem, however an
  214. illegal time will be rejected.
  215.  
  216. If the Shell is left in direct command mode for more  than
  217. about 2 hours, its internal clock will lose time. If  left
  218. in direct mode for any length of time, there will also  be
  219. a slight delay after RETURN is pressed, while the clock is
  220. updated.
  221.  
  222. This command can't be abbreviated (see ALIAS).
  223.  
  224. Error Messages
  225.  
  226. "The time is:<time>"-Standard report.
  227.  
  228.  
  229. 2.2.7 The DO Command
  230.  
  231. Format :DO [{<number><string>}]
  232.  
  233. The Shell remembers the last twenty commands,  and  allows
  234. the user to recall them to save time. The  DO  command  is
  235. the main mechanism for command line recall.  It  works  in
  236. two ways:-
  237.  
  238. 1.DO <number>
  239.  
  240. The Shell numbers each command line as it is entered.  The
  241. current number will usually be displayed when the Shell is
  242. waiting for some input. Using DO as above will recall  the
  243. command line that had the given number. See ECHO.
  244.  
  245. 2.DO <string>
  246.  
  247. Will search through the  stored  commands  looking  for  a
  248. command line that begins with the given string. Note  that
  249. the search begins at the most recently typed command line.
  250.  
  251. In either case, note that a command line  may  consist  of
  252. several commands, separated by semi-colons. Also note that
  253. only those commands entered at the Shell  prompt  will  be
  254. stored. Programs that allow access to the  Shell  routines
  255. are unlikely to update the list, though they may  well  be
  256. allowed to recall command lines.
  257.  
  258. If no argument is passed to the command,  a  list  of  the
  259. currently  stored  commands  will  be  displayed  in   the
  260. following format:-
  261.  
  262.              <command.number> <command.line>
  263.  
  264. Error Messages
  265.  
  266. "Command lost"-The Shell can't find the requested command.
  267.  
  268.  
  269. 2.2.8 The ALIAS Command
  270.  
  271. Format :ALIAS [<word>[/<phrase>]]
  272.  
  273. The Shell can be programmed to substitute the  first  WORD
  274. in a statement for a PHRASE. The phrase may  both  contain
  275. any number of characters. The shell removes the word  from
  276. the statement and replaces it with the phrase.
  277.  
  278. If only  <word>  is  given,  the  Shell  will  delete  the
  279. instruction for replacing occurrences of <word>.
  280.  
  281. If no phrases are given, the Shell will list the currently
  282. defined instructions.
  283.  
  284. To  allow  multiple  commands  to  be   substituted,   the
  285. semicolon will need to be inhibited. This can be  done  by
  286. typing a pair of semicolons:-
  287.  
  288.    ALIAS ebl/echo Editing Login file;;ctx -/login.usr
  289.  
  290. Several internal  commands  are  created  using  ALIAS  in
  291. conjunction with ECHO (see later). These commands are:-
  292.  
  293. TIME:ALIAS time/ECHO The time is:!t!c0A!c0d
  294.  
  295. PWD:ALIAS pwd/The working directory is:!w!c0A!c0D
  296.  
  297. Also MODE & CLS, which are  covered  later.  Creating  the
  298. commands this way makes  more  efficient  use  of  memory.
  299. Unfortunately it does mean that these  commands  can't  be
  300. abbreviated.
  301.  
  302. It can save typing effort if you create your own  commands
  303. to move into often used directories, eg:-
  304.  
  305.   ALIAS ebl/ECHO Moving into source directory;;cd -/ebl
  306.  
  307. Note that when ALIAS is used in a login file,  any  double
  308. semicolons should be replaced by a single semicolon, since
  309. the login interpreter  does  not  allow  multiple  command
  310. statements, and hence does not recognise  the  delimiting
  311. abilities of the semicolon.
  312.  
  313. ALIAS does not distinguish between upper  and  lower  case
  314. letters.
  315.  
  316. Error Messages
  317.  
  318. "No room"-No more ALIASes can be defined.
  319.  
  320.  
  321. 2.2.9 The ECHO Command
  322.  
  323. Format :ECHO <CXtring>
  324.  
  325. Passes (reads  and  evaluates)  the  given  "CXtring"  and
  326. outputs the result  on  the  VDU.  This  command  is  very
  327. powerful as the CXtring can contain meta characters, which
  328. are prefixed by "!" ("Pling").
  329.  
  330. Echo  has  several  uses.  Firstly,  it  can  be  used  in
  331. conjunction with a LOGIN file to display sign on messages,
  332. it is also used to display the time and  can  be  used  in
  333. conjunction with ALIASed commands to  let  the  user  know
  334. what a particular ALIAS is doing.
  335.  
  336. The Meta characters allowed are:-
  337.  
  338. "w" : Output working directory.
  339. "!" : Outputs a `!'.
  340. "d" : Outputs the current date.
  341. "t" : Outputs the current time.
  342. "u" : Outputs the current user's name.
  343. "c"<00.FF> : Outputs the character whose  ASCII  code   is
  344. given in hexadecimal. The sequence !c0A!c0D will  start  a
  345. new line on the screen.
  346. "$"<0..99><char.> Outputs the given number  of  the  given
  347. character.
  348. "n" : Outputs the current prompt number - See DO.
  349. "g" : "Ring" the chime bell. This bell is also rung on the
  350. hour to sound the chimes.
  351.  
  352.  
  353. 2.2.10 The PROMPT Command
  354.  
  355. Format :PROMPT <CXtring>
  356.  
  357. The Shell can be programmed to  output  a  prompt  message
  358. whenever it  is  expecting  a  command  line.  The  PROMPT
  359. command allows the user to define this message.
  360.  
  361. The message is given as a CXtring, which is defined in the
  362. entry on ECHO. If no CXtring is given, the prompt will not
  363. appear.
  364.  
  365.  
  366. 2.2.11 The CLS Command
  367.  
  368. Format :CLS
  369.  
  370. This command clears the screen. CLS is  defined  with  the
  371. ALIAS mechanism:-
  372.  
  373. ALIAS cls/ECHO !c0C
  374.  
  375. This command can't be abbreviated (see ALIAS).
  376.  
  377. 2.2.12 The MODE Command
  378.  
  379. Format :MODE <number>
  380.  
  381. Again, this is defined using ALIAS, using a clever trick:-
  382.  
  383. ALIAS mode/ECHO !c04!c
  384.  
  385. This command can't be abbreviated (see ALIAS).
  386.  
  387. Note that the construct !c <digit> is quite  valid,  and
  388. hence the above command works.
  389.  
  390.  
  391. 2.2.13 The ENLARGE Command
  392.  
  393. Format :ENLARGE [<command statement>]
  394.  
  395. This command toggles the Shell residency between Transient
  396. and Permanent (the default). When the Shell is  transient,
  397. it is usually only present when it is needed.
  398.  
  399. The advantage gained from Transient mode is that you  have
  400. an extra 7K of memory available. The disadvantage is  that
  401. Shell commands are no longer accessible  from  within  TPs
  402. (such as the text editor),  and  returning  to  the  Shell
  403. prompt after completion of an external command takes a few
  404. seconds longer.
  405.  
  406. If the <command statement> is given, the Shell  will  only
  407. be removed for the duration of the given command.
  408.  
  409.  
  410. 2.2.14 PATH
  411.  
  412. Syntax :PATH ++<Directory path>
  413.  
  414. Lists the directories in which the Shell is to  look  when
  415. an external command is issued if the external  command  is
  416. not found in one of  these  directories,  then  the  error
  417. message "<name> ?" is issued. Note the the path "/COM"  is
  418. always searched, and  that  the  Shell  defaults  to  also
  419. searching "." (the current directory).
  420.  
  421.  A P T E R    T W OΩ
  422.  
  423.                    ╔Command DictionaryΘ
  424.  
  425. ╩2.1 Shell PhraseologyΩ
  426.  
  427. ╔<director