home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / files / utility / system2 / manual < prev    next >
Text File  |  1985-11-19  |  78KB  |  2,108 lines

  1. [
  2. ?
  3.  
  4.    *******                                                     ********
  5.   ***   ***                       ***                        ***      ***
  6.   ***                             ***                                  ***
  7.    ***       ***   ***  ******  ********     ******  **********        ***
  8.     ****     ***   *** ***  ***   ***       ***  *** *** *** ***      ***
  9.        ***    ***  ***  ***       ***       ******** *** *** ***     ***
  10.         ***   *** ***     ****    ***       ***      *** *** ***    ***
  11.   ***   ***    *****   ***  ***   ***   *** ***  *** *** *** ***  ***
  12.    ******      ***      ******     ******    ******  *** *** *** ***
  13.              ***                                               ***     ***
  14. ----------****-----Operating Environment for the Atari ST-----*************--
  15.  
  16.                            Written by David Wild.
  17.  
  18.  
  19.                           U S E R ' S  M A N U A L
  20.  
  21.  
  22.                   Type HELP INDEX for a list of subjects
  23.  
  24.  
  25. ]
  26. [
  27. INDEX
  28. System 2 operating environment            User's Guide         index page 1
  29. ---------------------------------------------------------------------------
  30.  
  31.                                    INDEX
  32.                                    -----
  33.    
  34.        DETAILS                                     REFERENCED UNDER
  35.  
  36.        Introduction and details                           intro
  37.        About the author                                   author
  38.        A note on the syntax used in this manual           syntax
  39.        Starting System2                                   starting
  40.        General usage of System2                           general
  41.        Special characters                                 special
  42.        Device names                                       devices
  43.        Redirection & piping                               redirection
  44.        Macros                                             macros
  45.        Variables                                          variables 
  46.        System Variables                                   system
  47.        XSL programs                                       xsl-programs
  48.        The little things in life                          oddments
  49.        Writing programs to run under System2              technical
  50.  
  51.        Internal Commands
  52.          baud                                             baud
  53.          cat                                              cat
  54.          cd                                               cd
  55.          chmod                                            chmod
  56.          clear                                            clear
  57.          contains                                         contains
  58.          cp                                               cp
  59.          date                                             date
  60.          decr                                             decr
  61.          del                                              del
  62.          dir                                              dir
  63.          diskfree                                         diskfree
  64.          drive                                            drive
  65.          echo                                             echo
  66.          else                                             else
  67.          endif                                            endif
  68.          equal                                            equal
  69.          exists                                           exists
  70.          exit                                             exit
  71.          false                                            false
  72.          getc                                             getc
  73.          goto                                             goto
  74.          if                                               if
  75.          incr                                             incr
  76.          input                                            input
  77.          istrue                                           istrue
  78.          locate                                           locate
  79.          ls                                               ls
  80.          mcat                                             mcat
  81.          mkdir                                            mkdir
  82.          mkill                                            mkill
  83.          mv                                               mv
  84.          notequal                                         notequal
  85.          path                                             path
  86.          pr                                               pr
  87.          putc                                             putc
  88. ]
  89. [
  90. INDEX
  91. System 2 operating environment            User's Guide         index page 2
  92. ---------------------------------------------------------------------------
  93.  
  94.                                    INDEX
  95.                                    -----
  96.    
  97.        DETAILS                                     REFERENCED UNDER
  98.  
  99.          pwd                                              pwd
  100.          quit                                             quit
  101.          ren                                              ren
  102.          result                                           result
  103.          rm                                               rm
  104.          rmdir                                            rmdir
  105.          set                                              set
  106.          time                                             time
  107.          true                                             true
  108.          type                                             type
  109.          unset                                            unset
  110.          xsl                                              xsl
  111.          .                                                .
  112.          $                                                $
  113.          *                                                *
  114.  
  115.        External commands
  116.          help                                             help
  117.          bombs                                            bombs
  118.          tl50                                             tl50
  119.          tl25                                             tl25
  120.  
  121.        Glossary                                           glossary
  122.  
  123.          
  124. ]
  125. [
  126. INTRO
  127. System 2 operating environment            User's Guide         Introduction
  128. ---------------------------------------------------------------------------
  129.  
  130.  
  131.                          INTRODUCTION AND DETAILS
  132.                          ------------------------
  133.  
  134.  
  135. System 2 is an operating system shell for the Atari ST computer. It should
  136. work without problem on all versions of the computer and TOS.
  137.  
  138. What is an operating system shell (a.k.a Command Line Interpreter)?
  139.  
  140. An OS shell, like System2, provides a different method of giving commands
  141. to the computer. The usual way of controlling things on the ST is via the
  142. GEM desktop, where you drag files around, etc. with the mouse. This is all
  143. good stuff, but there are many instances when it can be restrictive, such
  144. as in copying & deleting files, formatting text, running TOS programs, etc.
  145. This is where System2 comes into it's own. It allows commands to be typed
  146. in, instead of using a graphical front end, and is in many ways similar to
  147. Unix*. Here are some of it's features:
  148.  
  149.   o  Unix Style command entry
  150.   o  Full input/output redirection & piping
  151.   o  Around 50 built-in commands
  152.   o  Ability to quickly recall the last 10 commands typed
  153.   o  Only takes up around 45K of memory
  154.   o  Aliasing and variables
  155.   o  Mini programming language with IFs and GOTOs
  156.   o  Built in expression evaluator
  157.  
  158. System2 was written using Mark Williams C and assembler by:
  159.  
  160.                     David Wild
  161.                     62 Lascelles Avenue
  162.                     Withernsea
  163.                     North Humberside
  164.                     HU19 2EB
  165.                     England
  166.  
  167.                     JANET EMAIL : WILDDJ@UK.AC.ASTON.VAXB
  168.  
  169.  
  170.  
  171.  
  172.  
  173. ----------------------------------------------------------------------------
  174. * UNIX is a registered trademark of AT&T Bell Laboratories
  175. ]
  176. [
  177. AUTHOR
  178. System 2 operating environment   User's Guide              About the author
  179. ---------------------------------------------------------------------------
  180.  
  181.                              About the author
  182.                              ================
  183.  
  184.  
  185. Hello! I'm David Wild, the author of System2, and I just thought I'd say
  186. a bit about myself. I'm 19, and am currently doing a computer science
  187. degree at Aston University in Birmingham. The idea for writing System2
  188. came from an interest in Unix, so many of the commands have a similar
  189. "Look and feel" to them (Oh dear, I shouldn't have said that. What's
  190. betting I have 100 lawsuits from AT&T through the door in a few weeks
  191. time!!). System2 isn't anywhere near as powerful as Unix (TM (R) (C) etc..)
  192. but it is hopefully a useful program.
  193.  
  194. If you have any suggestions, queries, complaints, etc., please write to me
  195. at:
  196.  
  197.                         62 Lascelles Avenue
  198.                         Withernsea
  199.                         North Humberside
  200.                         HU19 2EB
  201.  
  202. Or send JANET EMail to
  203.  
  204.                         WILDDJ@UK.AC.ASTON.VAXB 
  205.  
  206. ]
  207. [
  208. SYNTAX
  209. System 2 operating environment            User's Guide               syntax
  210. ---------------------------------------------------------------------------
  211.  
  212.  
  213.                         SYNTAX USED IN THE MANUAL
  214.                         -------------------------
  215.  
  216. The following syntax conventions are used in this manual when describing
  217. commands:
  218.  
  219. o Items of text written directly should be typed in directly
  220. o Text enclosed in < and > signifies where you should supply some
  221.   information, eg a filename
  222. o Items in square brackets, ie [ and ], are optional
  223. o Items separated by a bar (|) mean you can enter ONE of the separated
  224.   items
  225. o An ellipsis (...) means that the last item can be repeated several times
  226.  
  227. Do not confuse the < and > above with the redirection operators, or
  228. the | sign with the piping operator.
  229.  
  230. Example:
  231.  
  232.                      cat [<filespec> ... ]
  233.                      
  234.                       ^        ^      ^
  235.                      type  supplied  may be
  236.                   directly   value   repeated
  237.  
  238.                          \______  ______/
  239.                                 \/
  240.                              optional
  241.  
  242. ]
  243. [
  244. STARTING
  245. System 2 operating environment   User's Guide                      starting
  246. ---------------------------------------------------------------------------
  247.  
  248.                             STARTING UP SYSTEM2
  249.                             -------------------
  250.  
  251. To start up System2, insert the disk and double click on the SYSTEM2.TOS
  252. icon. System2 will only work in medium or high resolution.
  253. ]
  254. [
  255. GENERAL
  256. System 2 operating environment   User's Guide                 general usage
  257. ---------------------------------------------------------------------------
  258.  
  259.  
  260.                          GENERAL USAGE OF SYSTEM2
  261.                          ------------------------
  262.  
  263. When you first load up System2, an introductory message will appear, and a
  264. prompt (a $ sign) will appear, which means that the computer is telling you
  265. it's waiting for you to type something (the prompt can be changed with the
  266. set command). At this prompt, you can type in a command line. A command
  267. line takes the following form:
  268.  
  269.      command [<qualifiers>] [<parameters>] [< <input>] [> <output>]
  270.  
  271. After a command line is typed, the RETURN key is pressed in order to
  272. carry out a command.
  273.  
  274. The command is the name of the command which you want to carry out, which
  275. can be either the name of an in-built command (see the internal commands
  276. section of the manual), or the name of an external command (ie a program
  277. on a disk that you wish to run. The following are examples of valid
  278. commands:
  279.  
  280.                          cat
  281.                          dir
  282.                          a:\bin\test
  283.                          utils\abc
  284.  
  285. External commands are assumed to have the filename extension .tos, .ttp
  286. or .prg. Note that GEM programs (ie that use the mouse) cannot be run
  287. under System2.
  288.  
  289. The parameters are values that are supplied to a command, such as
  290. filenames and data. The qualifiers are only used in some commands, and
  291. are a special type of parameter: they start with a '-' and consist of a 
  292. set of letters which dictate the ways in which the commands work.
  293. For example, in the dir command,
  294.  
  295.                          dir -w *.c
  296.  
  297. the w qualifier sets the dir command to work in wide mode.
  298.  
  299. The <input and >output parts define any redirection that may take place,
  300. and are discussed in the section on redirection & piping.
  301.  
  302. More than one command line can be placed on one line. Command lines are
  303. separated by a ; or a | character. A ; allows several commands to be
  304. entered on one line as if they had been typed consecutively on several
  305. lines, for example
  306.  
  307.                         dir -w ; cat
  308.  
  309. is the same as typing
  310.  
  311.                         dir -w
  312.                         cat
  313.  
  314.  
  315.  
  316.  
  317.  
  318. ]
  319. [
  320. GENERAL
  321. System 2 operating environment   User's Guide          general usage page 2
  322. ---------------------------------------------------------------------------
  323.  
  324. If the | (pipe) character is used, then the output of one command is
  325. fed into the next. See the section on redirection & piping for more
  326. details.
  327.  
  328. A few control keys will work whilst typing, which allows simple editing.
  329. Pressing BACKSPACE deletes the last character entered. Pressing
  330. CONTROL and A restores deleted characters one by one, and CONTROL R
  331. will move back through the last 10 command lines typed, allowing you
  332. to repeat commands. For example, if you had typed "cobmands" instead
  333. of "commands", you could press BACKSPACE 6 times, type "m", then press
  334. CONTROL A five times, to restore the other deleted characters.
  335.  
  336. By default, all characters on the line are converted to upper case, and
  337. items of text cannot contain spaces (as these would be interpreted as
  338. separating parameters, etc). To remedy this, items may be placed in quotes
  339. (either double or single) which allows spaces, and text in quotes is not
  340. put into upper case. Also, items in quotes will not be treated as
  341. potential variables or be subject to macro substitution (see section on
  342. macros & variables). For example, the echo command displays it's parameters
  343. on the screen, so
  344.  
  345.                       echo hello
  346.  
  347. would display HELLO on the screen. However,
  348.  
  349.                       echo "hello"
  350. or                    echo 'hello'
  351.  
  352. would display
  353.  
  354.                       hello
  355. on the screen.
  356.  
  357. If you wish to include a quote character within quotes, use the opposite
  358. type of quotes for the text. For example,
  359.  
  360.                       echo "This is 'some' text"
  361. displays              This is 'some' text
  362.  
  363. and                   echo 'This is "some" text'
  364. displays              This is "some" text
  365.  
  366. A command line may only be 80 characters long. Unpredictable results may
  367. occur with lines longer than this.
  368. ]
  369. [
  370. SPECIAL
  371. System 2 operating environment   User's Guide            special characters
  372. ---------------------------------------------------------------------------
  373.  
  374.  
  375.                   SPECIAL CHARACTERS & CONTROL CHARACTERS
  376.                   ---------------------------------------
  377.  
  378.     CHARACTER                        USE
  379.  
  380.      " or '           For enclosing literal text
  381.  
  382.        ;              Separates commands on a line
  383.  
  384.        |              Pipes commands together
  385.  
  386.        <              Allows input redirection
  387.  
  388.        >              Allows output redirection
  389.  
  390.        %              Starts a variable name
  391.  
  392.  
  393.  
  394.     BACKSPACE         Deletes last character entered
  395.  
  396.     CONTROL A         Undelete character
  397.  
  398.     CONTROL R         Recall command line
  399.  
  400. ]
  401. [
  402. DEVICES
  403. System 2 operating environment   User's Guide                       devices
  404. ---------------------------------------------------------------------------
  405.  
  406.  
  407.                                 DEVICES
  408.                                 -------
  409.  
  410. When using System2, there are three reserved filenames which correspond
  411. to actual physical devices - the screen, the RS232 port and the printer.
  412. The device names may be used in place of file names, and allow the
  413. devices to be treated as files. The devices are:
  414.  
  415.  
  416.     CON:                    Refers to screen for output
  417.                             & keyboard for input
  418.  
  419.     AUX:                    Refers to a device connected to the RS232 port
  420.  
  421.  
  422.     PRN:                    Refers to the printer for output.
  423.                             Inputting from this device is not possible.
  424.  
  425.  
  426. These devices are especially useful in redirection, for example,
  427.  
  428.                       echo "Hello" > prn:
  429.  
  430. prints "Hello" on the printer. By default, input and output is to the
  431. CON: device.
  432. ]
  433. [
  434. REDIRECTION
  435. System 2 operating environment   User's Guide          redirection & piping
  436. ---------------------------------------------------------------------------
  437.  
  438.  
  439.                            REDIRECTION AND PIPING
  440.                            ----------------------
  441.  
  442. Most commands allow data to output to a theoretical device called the
  443. standard output (stdout) and input from a theoretical standard input
  444. (stdin). By default, the stdin and stdout are mapped to the CON: device
  445. (see section on devices), corresponding to keyboard for input and the
  446. screen for output, but these can be changed. This is known as redirection.
  447.  
  448. A device can be permanently set for stdin or stdout by using the set
  449. command. For example, after typing
  450.  
  451.                       set stdin=AUX:
  452.  
  453. all input will be taken from a device, such as a terminal, connected to the
  454. RS232 port. Correspondingly,
  455.  
  456.                       set stdout=PRN:
  457.  
  458. will send all output to the printer instead of the screen. Issuing a
  459.  
  460.                       set stdout=CON:
  461.  
  462. command will return back to normal screen output.
  463.  
  464. There is another method of redirection, which allows  a single command
  465. to output to either a device or a disk file, and input from either a
  466. device or disk file. It is carried out using the '<' and '>' symbols;
  467. '<' stands for input redirection and '>' for output redirection. These
  468. symbols, if given, should come after the command and it's parameters. The
  469. symbols are followed by either the name of a disk file, or the name of
  470. a device (CON:, AUX:, or PRN:). For example,
  471.  
  472.                       echo "Hello" > prn:
  473.  
  474. prints "Hello" on the printer
  475.  
  476.                       cat > fred.doc
  477.  
  478. Takes input from the keyboard, & puts it into file fred.doc
  479.  
  480.                       cat <bill.doc >fred.doc
  481.    
  482. Takes input from the file bill.doc and puts it into fred.doc (effectively
  483. copying file bill.doc to file fred.doc.
  484.  
  485. System2 is not fussy about whether spaces are present or not between the
  486. command and the '<' or '>' symbol, or between the symbol and the filename.
  487.  
  488. There is a special kind of output redirection to a file: if two '>' symbols
  489. are placed together, then output will be added to the end of an existing
  490. file, instead of a new file being created. For example,
  491.  
  492.                       cat bill.doc >> fred.doc
  493.  
  494. will append file bill.doc onto the end of file fred.doc.
  495.  
  496.  
  497.  
  498.  
  499. ]
  500. [
  501. REDIRECTION
  502. System 2 operating environment   User's Guide   redirection & piping page 2
  503. ---------------------------------------------------------------------------
  504.  
  505.  
  506. There is yet another kind of redirection - piping. Piping allows the
  507. output of one command to be taken as the input of another. The
  508. commands are separated by the '|' (bar) symbol. For example,
  509.  
  510.                       dir | pr -i10
  511.  
  512. will display a disk directory with a left margin of 10 spaces - the output
  513. of dir (a directory listing) is fed in as the input to the pr command
  514. which, in this case, displays it on the screen with a left margin.
  515. Piping & redirection can be mixed, so
  516.  
  517.                       dir | pr -i10 > neatdir.doc
  518.  
  519. would do the same as above, but it sends the output to a file called 
  520. neatdir.doc. Pipes can be used together, for example, if you had a disk
  521. program called uniq.ttp which removed identical lines from a file, then
  522. you could type
  523.  
  524.                       dir | uniq | pr -i10 > neatdir.doc
  525.  
  526. You cannot both redirect and pipe the output of a command - for instance,
  527.  
  528.                       dir > fred.doc | pr
  529.  
  530. is not valid.
  531.  
  532. The pipe has to create a temporary file while in use, which is deleted when
  533. no longer needed (named PIPE.TMP). The place where this is created can be
  534. set by setting the TMPPATH system variable.
  535.  
  536. Another theoretical device, stderr, exists within System2, which determines
  537. where error messages are sent. For example
  538.  
  539.                       set stderr=AUX:
  540.  
  541. sends all System2 error messages to the AUX: device. Note that this may
  542. not work with external TOS programs, since stderr is not normally defined
  543. on the ST.
  544.  
  545. Also look at - set, system variables
  546. ]
  547. [
  548. MACROS
  549. System 2 operating environment   User's Guide                        macros
  550. ---------------------------------------------------------------------------
  551.  
  552.  
  553.                                    MACROS
  554.                                    ------
  555.  
  556. Suppose you wanted the dir command to split it's output into pages of
  557. length 20 lines with 2 lines between pages. You can do this by typing
  558.  
  559.                       dir | pr -l20s2
  560.  
  561. but it is tedious typing this every time. However if you type in
  562.  
  563.                       set neatdir:"dir | pr -l20s2"
  564.  
  565. then every time you type in neatdir, you will get a split listing - try
  566. it! The name 'neatdir' is called a macro.
  567. Once a macro has been set as above, then EVERY occurrence of this string
  568. on the command line (except text in quotes) is replaced by the supplied
  569. string. For example, after typing
  570.  
  571.                       set much:"a load of"
  572.  
  573. then
  574.  
  575.                       echo "This is "much" rubbish"
  576.  
  577. would display         This is a load of rubbish
  578.  
  579. and                   echo thismuchrubbish
  580.  
  581. would display         THISALOADOFRUBBISH
  582.  
  583. Care should be taken - if you defined a macro, for example,
  584.  
  585.                       set in:"set stdin=aux:"
  586.  
  587. then typing
  588.  
  589.                       echo i-think-we-made-a-mess
  590.  
  591. would display         I-THSETSTDIN=AUX:K-WE-MADE-A-MESS
  592.  
  593. Macros can be unset by the mkill command or by using unset. Note that the
  594. macro name should be placed in quotes, eg
  595.  
  596.                       unset "much"
  597.  
  598. or else the name of the macro to be unset will be taken as the VALUE of
  599. much!
  600.  
  601. Commands to look at - set, unset, mkill, incr, decr, eval, echo
  602. ]
  603. [
  604. VARIABLES
  605. System 2 operating environment   User's Guide                     variables
  606. ---------------------------------------------------------------------------
  607.  
  608.  
  609.                                  VARIABLES
  610.                                  ---------
  611.  
  612. Variables are a special type of macro, and in most instances, a macro can
  613. be used in place of a variable. Variables are set up in exactly the same
  614. way as a macro, but they are distinguished from macros by putting a % sign
  615. at the start of the name, for example,
  616.  
  617.                       set %age=19
  618.  
  619. The main differences from macros are:
  620.  
  621.   o  In the input, unset, incr, etc. commands, the name of the variable
  622.      does not need to be put in quotes, eg incr %age instead of incr "age"
  623.  
  624.   o  Substitution of the value only occurs if the variable is given on
  625.      its own as a parameter, eg
  626.  
  627.                       set age="fred"
  628.                       echo 123age456
  629.  
  630.      displays         123fred456
  631.  
  632.      but              set %age="fred"
  633.                       echo 123%age456
  634.  
  635.      displays         123%age456
  636.  
  637.   
  638. Variables' values can be easily changed with the set, incr and decr
  639. commands. See the relevant sections for details.
  640. ]
  641. [
  642. SYSTEM
  643. System 2 operating environment   User's Guide              system variables
  644. ---------------------------------------------------------------------------
  645.  
  646.  
  647.                              SYSTEM VARIABLES
  648.                              ----------------
  649.  
  650. There are several variables which are already defined in System2. These
  651. can be split into two types - ones which can be set with the Set command,
  652. and ones which cannot. If system variables are being set with the set
  653. command, then the % sign is not entered - eg to set the %stderr system
  654. variable to AUX:, you would enter
  655.  
  656.                  set stderr=aux:
  657.  
  658. but you would still type
  659.  
  660.                  echo %stderr
  661.  
  662.  
  663. System variables which can be set:
  664. ----------------------------------
  665.  
  666. NAME            POSSIBLE VALUES     DESCRIPTION
  667.  
  668. %colour             0-3             Sets colour pen used for text output
  669.  
  670. %echo              ON or OFF        Determines whether text input is
  671.                                     echoed on the standard output (useful
  672.                                     for entering passwords and on echoing
  673.                                     terminals
  674. %lf                ON or OFF        Sets if linefeeds contain LF character
  675.  
  676. %paper              0-3             Sets colour pen used for background
  677.  
  678. %prompt           any string        Contains system prompt
  679.  
  680. %stderr          CON: AUX: or PRN:  Standard error device
  681.  
  682. %stdin           CON: AUX: or PRN:  Standard input device
  683.  
  684. %stdout          CON: AUX: or PRN:  Standard output device
  685.  
  686. %syscol             0-3             Colour pen used for text input
  687.  
  688. %tmppath          pathname          place where temporary pipe files are
  689.                                     stored
  690.  
  691. System variables which can't be set:
  692. ------------------------------------
  693.  
  694. %result          Contains returned result of last command
  695.  
  696. screenres       Contains screen resolution - 0=low, 1=medium, 2=high
  697. ]
  698. [
  699. XSL-PROGRAMS
  700. System 2 operating environment   User's Guide                  xsl-programs
  701. ---------------------------------------------------------------------------
  702.  
  703.  
  704.                                XSL PROGRAMS
  705.                                ------------
  706.  
  707. System2 has a batch programming facility known as XSL (eXternal Script
  708. Language). This allows System2 commands to be placed in sequence in a file,
  709. and this file is read in using the xsl command, and the commands are
  710. executed as if they had been typed into System2. Simple programming
  711. constructs are catered for, namely IF and GOTO.
  712.  
  713. Files containing XSL programs should have the extension .XSL. Some sample
  714. XSL files are provided in the directory SAMPLE.XSL. XSL programs can be
  715. created with any text editor, such as the micro emacs editor.
  716.  
  717. XSL programs can be passed parameters like programs. These paramaters are
  718. assigned to variables %1, %2, ... etc up to %9. So if an XSL program
  719. was run as follows (assuming it was called fred.xsl):
  720.  
  721.                     XSL fred hello there
  722.  
  723. then %1 would equal HELLO and %2 would equal THERE. Another variable,
  724. %argc, contains the number of parameters supplied.
  725.  
  726. If a file PROFILE.XSL exists in the same directory as System2, then when
  727. System2 is executed, this XSL program is read in and executed.
  728.  
  729. See also: xsl, if, goto
  730. ]
  731. [
  732. ODDMENTS
  733. System 2 operating environment   User's Guide                      oddments
  734. ---------------------------------------------------------------------------
  735.  
  736.  
  737.                        The Little things in life...
  738.                        ----------------------------
  739.  
  740. Here are some handy uses of System2 which may not be immediately obvious...
  741.  
  742. Printing out files
  743. ------------------
  744. Often, you want to print a file on the printer to put into a binder, say.
  745. Unfortunately, the GEM printing function does not have any formatting
  746. capabilities. Using the pr command, you can set the left hand margin, and
  747. split the file into neat pages for printing.
  748.  
  749. Sending control codes to the printer
  750. ------------------------------------
  751. If you wish to set your printer to a certain print mode, then this can
  752. easily be done using the putc command.
  753.  
  754. Copying files
  755. -------------
  756. The cp and cat commands are much more powerful than the GEM equivalents
  757.  
  758. Putting control codes at the start or end of files
  759. --------------------------------------------------
  760. To do this, use the putc command to create a fh⇧êOÇ⇩⇧âנüâêOîüä7À⓪1ÃØ2¨åà4Ã⑥⓪0Ã2⓪:¨ØÉ:42É1ã´⓪1ÃÀÀãÃ2⓪:7É57œÃ⓪:42É34À2¨û⓪7¨⓪:¨ØÉ:42É0Õ82Ã24Ã3åà92Ø4¨2õ´4ÃÃ⓪④④ù╱à?╱à)¶¨´2ÀÉ⑨⓪7Õ2¨0´4Ã3É2Ã;4¨7Ã6ØÃ:⓪⓪⓪*¨Ø¨③¨É#´œØ2É⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪:2õœ74õãÀ╱à⑥ûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûtance,
  761.  
  762.                       dir > fred.doc | pr
  763.  
  764. is not valid.
  765.  
  766. The pipe has to create a temporary file while in use, which is deleted when
  767. no longer needed (named PIPE.TMP). The place where this is created can be
  768. set by setting the TMPPATH system variable.
  769.  
  770. Another theoretical device, stderr, exists within System2, which determines
  771. where error messages are sent. For example
  772.  
  773.                       set stderr=AUX:
  774.  
  775. sends all System2 error messages to the AUX: device. Note that this may
  776. not work with external TOS programs, since stderr is not normally defined
  777. on the ST.
  778.  
  779. Also look at - set, system variables
  780. ]
  781. [
  782. MACROS
  783. System 2 operating environment   User's Guide                        macros
  784. ---------------------------------------------------------------------------
  785.  
  786.  
  787.                                    MACROS
  788.                                    ------
  789.  
  790. Suppose you wanted the dir command to split it's output into pages of
  791. length 20 lines with 2 lines between pages. You can do this by typing
  792.  
  793.                       dir | pr -l20s2
  794.  
  795. but it is tedious typing this every time. However if you type in
  796.  
  797.                       set neatdir:"dir | pr -l20s2"
  798.  
  799. then every time you type in neatdir, you will get a split listing - try
  800. it! The name 'neatdir' is called a macro.
  801. Once a macro has been set as above, then EVERY occurrence of this string
  802. on the command line (except text in quotes) is replaced by the supplied
  803. string. For example, after typing
  804.  
  805.                       set much:"a load of"
  806.  
  807. then
  808.  
  809.                       echo "This is "much" rubbish"
  810.  
  811. would display         This is a load of rubbish
  812.  
  813. and                   echo thismuchrubbish
  814.  
  815. would display         THISALOADOFRUBBISH
  816.  
  817. Care should be taken - if you defined a macro, for example,
  818.  
  819.                       set in:"set stdin=aux:"
  820.  
  821. then typing
  822.  
  823.                       echo i-think-we-made-a-mess
  824.  
  825. would display         I-THSETSTDIN=AUX:K-WE-MADE-A-MESS
  826.  
  827. Macros can be unset by the mkill command or by using unset. Note that the
  828. macro name should be placed in quotes, eg
  829.  
  830.                       unset "much"
  831.  
  832. or else the name of the macro to be unset will be taken as the VALUE of
  833. much!
  834.  
  835. Commands to look at - set, unset, mkill, incr, decr, eval, echo
  836. ]
  837. [
  838. VARIABLES
  839. System 2 operating environment   User's Guide                     variables
  840. ---------------------------------------------------------------------------
  841.  
  842.  
  843.                                  VARIABLES
  844.                                  ---------
  845.  
  846. Variables are a special type of macro, and in most instances, a macro can
  847. be used in place of a variable. Variables are set up in exactly the same
  848. way as a macro, but they are distinguished from macros by putting a % sign
  849. at the start of the name, for example,
  850.  
  851.                       set %age=19
  852.  
  853. The main differences from macros are:
  854.  
  855.   o  In the input, unset, incr, etc. commands, the name of the variable
  856.      does not need to be put in quotes, eg incr %age instead of incr "age"
  857.  
  858.   o  Substitution of the value only occurs if the variable is given on
  859.      its own as a parameter, eg
  860.  
  861.                       set age="fred"
  862.                       echo 123age456
  863.  
  864.      displays         123fred456
  865.  
  866.      but              set %age="fred"
  867.                       echo 123%age456
  868.  
  869.      displays         123%age456
  870.  
  871.   
  872. Variables' values can be easily changed with the set, incr and decr
  873. commands. See the relevant sections for details.
  874. ]
  875. [
  876. SYSTEM
  877. System 2 operating environment   User's Guide              system variables
  878. ---------------------------------------------------------------------------
  879.  
  880.  
  881.                              SYSTEM VARIABLES
  882.                              ----------------
  883.  
  884. There are several variables which are already defined in System2. These
  885. can be split into two types - ones which can be set with the Set command,
  886. and ones which cannot. If system variables are being set with the set
  887. command, then the % sign is not entered - eg to set the %stderr system
  888. variable to AUX:, yreturn being sent (sending the cursor to the left
  889. of the screen). To send a line feed (go to next line), press CONTROL J.
  890.  
  891. See also: type, cp, echo
  892. ]
  893. [
  894. CD
  895. System 2 operating environment   User's Guide - Internal Commands        cd
  896. ---------------------------------------------------------------------------
  897.  
  898. Command          cd
  899. Syntax           cd <path>
  900.  
  901. This command changes the current directory to the given path. All further
  902. commands (eg ls) will now operate on files in this directory. It is similar
  903. to double clicking on a folder from GEM.
  904.  
  905. To return to the root directory (the default, top level directory that
  906. contains all other directories and files), enter
  907.  
  908.                  cd \
  909.  
  910. Examples:
  911.                  cd \bin
  912.                  cd database\customer
  913.  
  914. See also: mkdir, rmdir, pwd, drive
  915.  
  916. ]
  917. [
  918. CHMOD
  919. System 2 operating environment   User's Guide - Internal Commands     chmod
  920. ---------------------------------------------------------------------------
  921.  
  922. Command          chmod
  923. Syntax           chmod <hrw> file
  924.  
  925. The chmod command allows the read/write and visibility status of a file
  926. to be altered. The first parameter consists of three flags, each of
  927. which can be the character shown above, or a dash ('-'). If the character
  928. is supplied, then the status corresponding to that character is set to on,
  929. otherwise it is set to off. h stands for hidden (ie not shown on the
  930. desktop), r for read access, and w for write access.
  931.  
  932. Examples:
  933.   chmod -rw fred.doc            Sets fred.doc to be visible, readable,
  934.                                 and writable
  935.   chmod hrw fred.doc            Sets fred.doc to be hidden, readable, and
  936.                                 writable
  937.   chmod -r- fred.doc            Sets fred.doc to be visible and read only
  938.   chmod hr- fred.doc            Sets fred.doc to be hidden and read only
  939.  
  940. Notes:
  941.  
  942. If a file is set to read only (ie r- as opposed to rw) then it cannot be
  943. altered or erased unless it's status is set back to rw. All files must
  944. be readable, so the r flag is compulsory, and only included for
  945. familiarity with Unix users. Any other characters apart from h, r & w
  946. in their appropriate positions are treated as being equivalent to a dash.
  947. ]
  948. [
  949. CLEAR
  950. System 2 operating environment   User's Guide - Internal Commands     clear
  951. ---------------------------------------------------------------------------
  952.  
  953. Command          clear
  954. Syntax           clear
  955.  
  956. The clear command clears the screen, and sets the cursor position to the
  957. upper left hand corner of the screen.
  958.  
  959. Example:
  960.                  clear
  961.  
  962. See also: locate
  963. ]
  964. [
  965. COMMANDS
  966. System 2 operating environment   User's Guide - Internal Commands  commands
  967. ---------------------------------------------------------------------------
  968.  
  969. Command          commands
  970. Syntax           commands
  971.  
  972. This commands produces a list of all the built-in System2 commands.
  973.  
  974. Example:
  975.  
  976.                  commands
  977.  
  978. Notes:
  979.  
  980. The list does not include the commands command!
  981. ]
  982. [
  983. CONTAINS
  984. System 2 operating environment   User's Guide - Internal Commands  contains
  985. ---------------------------------------------------------------------------
  986.  
  987. Command          contains
  988. Syntax           contains <string1> <string2>
  989.  
  990. The contains command returns a value of true (0) if <string2> is contained
  991. in <string1>, or false (-1) if it isn't. It is intended for use with the if
  992. command, for example,
  993.  
  994.          if contains %birdname "gull" ; echo "Seabird" ; echo ; endif
  995.  
  996. would print 'Seabird' on the screen if the variable %birdname contains
  997. the string 'gull'. All tests are case sensitive.
  998.  
  999. Examples:
  1000.  
  1001.   contains "this is some text" "some"             returns 0
  1002.   contains "this is some text" "SOME"             returns -1
  1003.   contains "this is some text" some               returns -1
  1004.   contains "this is SOME text" some               returns 0
  1005.   contains thisissometext some                    returns 0
  1006.  
  1007. Notes:
  1008.  
  1009. All tests are case sensitive, so "FRED" will not match 'Fred','fred', etc.
  1010.  
  1011. See also: equal, notequal, istrue
  1012. ]
  1013. [
  1014. CP
  1015. System 2 operating environment   User's Guide - Internal Commands        cp
  1016. ---------------------------------------------------------------------------
  1017.  
  1018. Command          cp
  1019. Syntax           cp <filespec> <destfilespec>
  1020.  
  1021. The cp command is used to copy files from one place to another (akin to
  1022. dragging files using the GEM desktop, only more powerful). The <filespec>
  1023. parameter describes the source file(s), and can contain wildcards. The
  1024. <destfilespec> parameter either specifies the path to which the files are
  1025. to be copied, or supplies the path/file name of a single file. Except in
  1026. the latter case, files will be given the same names as the files that
  1027. are being copied.
  1028.  
  1029. Examples:
  1030.                  cp a:*.c b:\source
  1031.                  cp *.c source
  1032.                  cp fred.dat b:
  1033.                  cp fred.dat b:Ç⇨ÇijëÄ⇧≡pנננננננננננננננננî◆נÄ@üä⇦î✓⇧ijijîOëijüä⇦îpp≡pÉÇ⇧ê⇦@≡p≡p£◆é⇩êOÇ⇧üé◆üêOêé⇧ê⇦OüÇOÇêOëê⇦⇧éÄ⇧éנêé⇧ê@④2œ ⑧ץ✓
  1034. ïÿז⑧ÄÖ£ÖY♪Ö⑧]
  1035. Hə\בBÿ[§ךY♪✓⑧¥]✓ם[✓Ö\§[✓ə[êף¢Hə⑨H⑧\§✓⑨ile being copied. If you wish
  1036. to create a composite file, use the cat command.
  1037.  
  1038. See also: cat, type
  1039. ]
  1040. [
  1041. DATE
  1042. System 2 operating environment   User's Guide - Internal Commands      date
  1043. ---------------------------------------------------------------------------
  1044.  
  1045. Command          date
  1046. Syntax           date [<dd> <mm> <yyyy>]
  1047.  
  1048. The date command will display the current date, or will allow the date to
  1049. be set if the three parameters (corresponding to day, month, year) are
  1050. supplied. The month is in numeric format (1-12) and the year is in four
  1051. digit format (1980-2099).
  1052.  
  1053. Examples:
  1054.                  date
  1055.                  date 2 4 1989
  1056.                  date 14 8 1985
  1057.  
  1058. Notes:
  1059.  
  1060. Validity checking is carried out on the dates, but this does not extend to
  1061. preventing the date being set to 30 February, 31 September, etc. 
  1062.  
  1063. See also: time
  1064. ]
  1065. [
  1066. DECR
  1067. System 2 operating environment   User's Guide - Internal Commands      decr
  1068. ---------------------------------------------------------------------------
  1069.  
  1070. Command          decr
  1071. Syntax           decr <variable>
  1072.  
  1073. The decr command will subtract 1 from the value held in a variable.
  1074.  
  1075. Examples:
  1076.                  decr %count
  1077.                  decr %value
  1078.  
  1079. decr is very useful if used in a loop in an xsl program ij#7¨⓪2¶0ÀÕ62û⓪:42åà<9À⓪897ø¨0À¥╱à╱à⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪9Ø´⓪②õôÃ:ÿÿ╱à⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⑦⓪67ÃÕ╱à⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪2õœ7É①$2À67æ╱à⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪2õœ7åà⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪22õ¨⓪②õôÃ:╱à⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪4ø⓪4¨´9:ØÉ②õôÃ:>ÿ⓪É3ô7É67ÃÕ⓪É2Ã24ø╱à⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪
  1080. Variables are a special type of macro, and in most instances, a macro can
  1081. be used in place of a variable. Variables are set up in exactly the same
  1082. way as a macro, but they are distinguished from macros by putting a % sign
  1083. at the start of the name, for example,
  1084.  
  1085.                       set %age=19
  1086.  
  1087. The main differences from macros are:
  1088.  
  1089.   o  In the input, unset, incr, etc. commands, the name of the variable
  1090.      does not need to be put in quotes, eg incr %age instead of incr "age"
  1091.  
  1092.   o  Substitution of the value only occurs if the variable is given on
  1093.      its own as a parameter, eg
  1094.  
  1095.                       set age="fred"
  1096.                       echo 123age456
  1097.  
  1098.      displays         123fred456
  1099.  
  1100.      but              set %age="fred"
  1101.                       echo 123%age456
  1102.  
  1103.      displays         123%age456
  1104.  
  1105.   
  1106. Variables' values can be easily changed with the set, incr and decr
  1107. commands. See the relevant sections for details.
  1108. ]
  1109. [
  1110. SYSTEM
  1111. System 2 operating environment   User's Guide              system variables
  1112. ---------------------------------------------------------------------------
  1113.  
  1114.  
  1115.                              SYSTEM VARIABLES
  1116.                              ----------------
  1117.  
  1118. There are several variables which are already defined in System2. These
  1119. can be split into two types - ones which can be set with the Set command,
  1120. and ones which cannot. If system variables are being set with the set
  1121. command, then the % sign is not entered - eg to set the %stderr system
  1122. variable to AUX:, ynction is made
  1123. between subdirectories and files. If the -w qualifier is not given, then the
  1124. output is of the form:
  1125.  
  1126.         <name> <file size> <date & time of creation> <file status>
  1127.  
  1128. The file status is given as a decimal number. This is the standard ST
  1129. attribute byte.
  1130.  
  1131. If the -a qualifier is specified, then all files that match the filespec
  1132. are shown, including system files that are normally hidden from the directory
  1133. list.
  1134.  
  1135. After the file list, the number of files matching the specification is shown
  1136. together with the number of bytes consumed by these files.
  1137.  
  1138. The optional filespec parameter can be (i) a filename with wildcards,
  1139. (ii) a disk drive letter followed by a colon, or (iii) a combination of
  1140. disk drive letter and filename.
  1141.  
  1142. Examples:
  1143.                 dir
  1144.                 dir *.c
  1145.                 dir -w a:\data\*.bak
  1146.                 dir -aw c:
  1147.  
  1148. See also: ls,cd,drive,pwd
  1149. ]
  1150. [
  1151. DISKFREE
  1152. System 2 operating environment   User's Guide - Internal Commands  diskfree
  1153. ---------------------------------------------------------------------------
  1154.  
  1155. Command          diskfree
  1156. Syntax           diskfree [<drive letter>]
  1157.  
  1158. This command will show the amount of free space left on the specified
  1159. drive, or the current drive if none is specified. The message returned
  1160. is of the form:
  1161.  
  1162.                  n bytes free out of m
  1163.  
  1164. where n is the disk space free, and m is the total storage capability of
  1165. the disk.
  1166.  
  1167. Notes:
  1168.  
  1169. The amount of space used is displayed with the dir or ls commands.
  1170.  
  1171. See also: dir, ls
  1172. ]
  1173. [
  1174. DRIVE
  1175. System 2 operating environment   User's Guide - Internal Commands     drive
  1176. ---------------------------------------------------------------------------
  1177.  
  1178. Command          drive
  1179. Syntax           drive <drive letter>
  1180.  
  1181. The drive command sets the default disk drive that is used by all commands.
  1182. <drive letter> must be in the range A-P, and the drive must exist. Drive A
  1183. corresponds to the first disk drive, and drive B to the second if you have
  1184. one fitted.
  1185.  
  1186. Examples:
  1187.                  drive a
  1188.                  drive d
  1189.  
  1190. See also: cd
  1191. ]
  1192. [
  1193. ECHO
  1194. System 2 operating environment   User's Guide - Internal Commands      echo
  1195. ---------------------------------------------------------------------------
  1196.  
  1197. Command          echo
  1198. Syntax           echo [<string1> <string2> ...]
  1199.  
  1200. This command outputs it's parameters to the standard output. No carriage
  1201. return is issued after the text is written. To issue a carriage return, use
  1202. echo without any parameters.
  1203.  
  1204. It is advisable to put direct text within quotes, otherwise it will be
  1205. converted to upper case, and will be subject to macro substitution.
  1206.  
  1207. Example session:
  1208.  
  1209. $ echo Hello
  1210. HELLO$ echo "Hello World"
  1211. Hello World$ echo "Hello World"; echo
  1212. Hello World
  1213. $ set %fred="Hello World"
  1214. $ echo %fred
  1215. Hello World$ echo Hello There World
  1216. HELLOTHEREWORLD$
  1217. ]
  1218. [
  1219. ELSE
  1220. System 2 operating environment   User's Guide - Internal Commands      else
  1221. ---------------------------------------------------------------------------
  1222.  
  1223. Command          else
  1224. Syntax           else
  1225.  
  1226. The else command is intended for use with the if statement. It will execute
  1227. all commands up to the corresponding endif statement, if the result of
  1228. the last if operation was false (ie non zero). For further details, see
  1229. the if command.
  1230.  
  1231. Example:
  1232.                  else
  1233.  
  1234. See also: if, endif
  1235. ]
  1236. [
  1237. ENDIF
  1238. System 2 operating environment   User's Guide - Internal Commands     endif
  1239. ---------------------------------------------------------------------------
  1240.  
  1241. Command          endif
  1242. Syntax           endif
  1243.  
  1244. The endif command signifies the end of a conditional block of code
  1245. controlled by an if statement. For further details, see the if command.
  1246.  
  1247. Example:
  1248.                  endif
  1249.  
  1250. See also: if, else
  1251. ]
  1252. [
  1253. EQUAL
  1254. System 2 operating environment   User's Guide - Internal Commands     equal
  1255. ---------------------------------------------------------------------------
  1256.  
  1257. Command          equal
  1258. Syntax           equal <string1> <string2>
  1259.  
  1260.  
  1261. The equal command returns a value of true (0) if <string2> is the same as
  1262. <string1>, or false (-1) if it isn't. It is intended for use with the if
  1263. command, for example,
  1264.  
  1265.        if equal %birdname "puffin" ; echo "Seabird" ; echo ; endif
  1266.  
  1267. would print 'Seabird' on the screen if the variable %birdname was equal to
  1268. the string 'puffin'. All tests are case sensitive.
  1269.  
  1270. Examples:
  1271.  
  1272.   equal "fred" "fred"                             returns 0
  1273.   equal "Fred" "fred"                             returns -1
  1274.   equal "fred" fred                               returns -1
  1275.   equal "fred" "james"                            returns 0
  1276.   equal fred fred                                 returns 0
  1277.  
  1278. Notes:
  1279.  
  1280. All tests are case sensitive, so "FRED" will not match 'Fred','fred', etc.
  1281.  
  1282. See also: notequal, contains, istrue
  1283. ]
  1284. [
  1285. EVAL
  1286. System 2 operating environment   User's Guide - Internal Commands      eval
  1287. ---------------------------------------------------------------------------
  1288.  
  1289. Command          eval
  1290. Syntax           eval <expression> [<expression> ...]
  1291.  
  1292. The eval command will evaluate a number of supplied expressions, and will
  1293. print the results out on the standard output. An expression can consist
  1294. of any one of the following:
  1295.  
  1296. (i) A numeric value, which is a number or a variable that gives a number.
  1297.     Examples: 5, 300000, 12345678, %age, %value
  1298.  
  1299. (ii) A number of numeric values separated by operators
  1300.      Examples: 5*8, 3+2*5, %age*2+71, %age/2=%value*50
  1301.  
  1302. Valid operators are (in order of precedence):
  1303.  
  1304. * (multiply)    / (divide)      + (add)         - (subtract)
  1305. = (equal)       { (less than)   } (greater than)
  1306.  
  1307. If a non-numeric & non-variable string is found, it will yield a value of
  1308. zero.
  1309.  
  1310. Examples:
  1311.                  eval 3*8+%age %age}17 3*3=9
  1312.  
  1313. - which, supposing age=15, results in 39 0 1 being displayed on the screen.
  1314.  
  1315. Notes:
  1316.  
  1317. All arithmetic is integer, ie no decimal points are allowed. The =
  1318. operator yields 1 if the expressions to either side are equal, or 0 if
  1319. they are not. Similarly { and } yield 1 if the left expression is less
  1320. or greater than the right expression respectively, otherwise 0. These
  1321. symbols were chosen instead of the more common < and > in order to avoid
  1322. possible confusion with the redirection symbols < and >.
  1323.  
  1324. See also: istrue, echo
  1325. ]
  1326. [
  1327. EXISTS
  1328. System 2 operating environment   User's Guide - Internal Commands    exists
  1329. ---------------------------------------------------------------------------
  1330.  
  1331. Command          exists
  1332. Syntax           exists <filespec>
  1333.  
  1334. This command returns true (0) if a file exists that matches the given
  1335. file specification, otherwise it returns false (-1).
  1336.  
  1337. Examples:
  1338.                  exists fred.doc
  1339.                  exists *.c
  1340.                  exists *.*
  1341.  
  1342. Notes:
  1343.  
  1344. The primary use of exists is in conjunction with the if statement in xsl
  1345. program. For example, the xsl segment
  1346.  
  1347.                  if exists "database.def"
  1348.                    * do nothing
  1349.                  else
  1350.                    echo "You need to create a database.def file!"
  1351.                    echo
  1352.                    exit -1
  1353.                  endif
  1354.  
  1355. would exit with a suitable error message if the file database.def does
  1356. not exist.
  1357.  
  1358. See also: if, xsl, $
  1359. ]
  1360. [
  1361. EXIT
  1362. System 2 operating environment   User's Guide - Internal Commands      exit
  1363. ---------------------------------------------------------------------------
  1364.  
  1365. Command          exit
  1366. Syntax           exit [<value>]
  1367.  
  1368. The exit command will stop execution of an xsl procedure, and return the
  1369. user to the System2 prompt. If a value is specified, this will be returned
  1370. to System2 as the return value of the xsl command, zero being returned by
  1371. default.
  1372.  
  1373. Examples:
  1374.                  exit
  1375.                  exit -1
  1376.  
  1377. See also: xsl, quit
  1378. ]
  1379. [
  1380. FALSE
  1381. System 2 operating environment   User's Guide - Internal Commands     false
  1382. ---------------------------------------------------------------------------
  1383.  
  1384. Command          false
  1385. Syntax           false
  1386.  
  1387. This command returns the value false (-1).
  1388.  
  1389. See also: true
  1390. ]
  1391. [
  1392. GETC
  1393. System 2 operating environment   User's Guide - Internal Commands      getc
  1394. ---------------------------------------------------------------------------
  1395.  
  1396. Command          getc
  1397. Syntax           getc
  1398.  
  1399. The getc command allows a single character to be input from the standard
  1400. input (the keyboard in most circumstances). It returns a value between
  1401. 0 and 255 corresponding to the ASCII value of the character that was
  1402. typed. If the input is from the keyboard (CON:, the default), then the
  1403. character is echoed on the screen.
  1404.  
  1405. Example:
  1406.                  getc
  1407.  
  1408. See also: putc, input
  1409. ]
  1410. [
  1411. GOTO
  1412. System 2 operating environment   User's Guide - Internal Commands      goto
  1413. ---------------------------------------------------------------------------
  1414.  
  1415. Command          goto
  1416. Syntax           goto label
  1417.  
  1418. The goto command is for use in xsl procedures, and causes a branch to
  1419. a part of the program that is labelled with the given label. A label
  1420. consists of a line in the program that contains a decimal point followed
  1421. by a space and the label name. See the decr command for a demonstration
  1422. of goto.
  1423.  
  1424. Example:
  1425.                  goto loop
  1426.  
  1427. See also: xsl,. ,decr
  1428. ]
  1429. [
  1430. IF
  1431. System 2 operating environment   User's Guide - Internal Commands        if
  1432. ---------------------------------------------------------------------------
  1433.  
  1434. Command          if
  1435. Syntax           if <command-line>
  1436.  
  1437. The if command allows commands to be executed only in certain
  1438. circumstances. The if command is followed by any System2 command line, and
  1439. it executes all commands up to the corresponding else or endif statement
  1440. only if this command line returns a value of true (0). This makes it
  1441. especially useful with the contains, equal, exists, false, istrue, and
  1442. true commands. Any commands between an else and an endif command are
  1443. executed only if the command line returns false (non zero). After the
  1444. endif, all processing carries on as normal. The if command is usually used
  1445. in two ways, either directly typed into System2, as in
  1446.  
  1447.     if istrue %age}17 ; echo "you can vote" ; echo ; endif
  1448.  
  1449. which displays "you can vote" if %age is greater than 17 (note the use of
  1450. the semicolon to separate the commands), or in an xsl program, such as the
  1451. segment below:
  1452.  
  1453.                  if istrue %age}17
  1454.                    echo "you can vote"
  1455.                    echo
  1456.                  else
  1457.                    echo "you can't vote"
  1458.                    echo
  1459.                  endif
  1460.  
  1461. Notes:
  1462.  
  1463. Nested ifs are allowed, provided they are all finished off with a
  1464. corresponding endif.
  1465.  
  1466. See also: else, endif, contains, equal, exists, false, istrue, true, xsl
  1467. ]
  1468. [
  1469. INCR
  1470. System 2 operating environment   User's Guide - Internal Commands      incr
  1471. ---------------------------------------------------------------------------
  1472.  
  1473. Command          incr
  1474. Syntax           incr <variable>
  1475.  
  1476. The incr command will add 1 to the value held in a variable.
  1477.  
  1478. Examples:
  1479.                  incr %count
  1480.                  incr %value
  1481.  
  1482. incr is very useful if used in a loop in an xsl program. For example, the
  1483. xsl program:
  1484.  
  1485.                  set %count=0
  1486.                  . loop
  1487.                  echo "Hello"
  1488.                  echo
  1489.                  incr %count
  1490.                  if istrue %count{10 ; goto loop ; endif
  1491.                  exit
  1492.  
  1493. will display "Hello" 10 times
  1494.  
  1495. Notes:
  1496.  
  1497. All arithmetic is in two byte integer form; incrementing over 32767 will
  1498. cause spurious results.
  1499. This command is equivalent to a two byte form of
  1500.                  set <variable>=<variable>+1
  1501.  
  1502. See also: decr, set, xsl
  1503. ]
  1504. [
  1505. INPUT
  1506. System 2 operating environment   User's Guide - Internal Commands     input
  1507. ---------------------------------------------------------------------------
  1508.  
  1509. Command          input
  1510. Syntax           input <variable> [<prompt>]
  1511.  
  1512. The input command allows a line of text to be input from the keyboard, and
  1513. this text is assigned to the specified variable, as if the set command
  1514. had been used. If the prompt parameter is supplied, then this prompt is
  1515. displayed on standard output before the user is allowed to input. If no
  1516. prompt is supplied, then a dash ('-') is output as a prompt.
  1517.  
  1518. Examples:
  1519.                  input %name
  1520.                  input %name "Please enter your name>"
  1521.  
  1522. Notes:
  1523.  
  1524. If you do not wish a prompt to be output, then use input <variable> ""
  1525.  
  1526. See also: getc
  1527. ]
  1528. [
  1529. ISTRUE
  1530. System 2 operating environment   User's Guide - Internal Commands    istrue
  1531. ---------------------------------------------------------------------------
  1532.  
  1533. Command          istrue
  1534. Syntax           istrue <expression>
  1535.  
  1536. This command yields a value of true (0) if the given expression is true,
  1537. else it returns a value of false. For a description of an expression, see
  1538. the eval command. The istrue command is very useful if used in conjunction
  1539. with the if command, as shown in the example below:
  1540.  
  1541.   if istrue %size}1000 ; echo "Size too large" ; endif
  1542.  
  1543. Examples:
  1544.                  istrue %fred+2=%bill-1
  1545.                  istrue %fred
  1546.  
  1547. See also: eval, equal, notequal
  1548. ]
  1549. [
  1550. LOCATE
  1551. System 2 operating environment   User's Guide - Internal Commands    locate
  1552. ---------------------------------------------------------------------------
  1553.  
  1554. Command          locate
  1555. Syntax           locate x y
  1556.  
  1557. The locate command will allow the cursor to be positioned on the screen.
  1558. The given x and y coordinates begin at 0, and are relative to the top left
  1559. of the screen. Usually, x should be from 0 to 79 and y from 0 to 24.
  1560.  
  1561. See also: clear
  1562. ]
  1563. [
  1564. LS
  1565. System 2 operating environment   User's Guide - Internal Commands        ls
  1566. ---------------------------------------------------------------------------
  1567.  
  1568. Command          ls
  1569. Syntax           ls [-[la]][<filespec>]
  1570.  
  1571. This command displays a list of all the files that are stored on a disk.
  1572.  
  1573. Unless the -l (long) qualifier is specified, only the names of the files or
  1574. directories that match the filespec are output, and no distinction is made
  1575. between subdirectories and files. If the -l qualifier is given, then the
  1576. output is of the form:
  1577.  
  1578.         <file status> <file size> <date & time of creation> <name>
  1579.  
  1580. The file status is given as three characters. An r indicates that the file
  1581. can be read (always the case), a w indicates that the file can be written
  1582. to (not read only), and a d indicates a subdirectory.
  1583.  
  1584. If the -a qualifier is specified, then all files that match the filespec
  1585. are shown, including system files that are normally hidden from the directory
  1586. list.
  1587.  
  1588. After the file list, the number of files matching the specification is shown
  1589. together with the number of bytes consumed by these files.
  1590.  
  1591. The optional filespec parameter can be (i) a filename with wildcards,
  1592. (ii) a disk drive letter followed by a colon, or (iii) a combination of
  1593. disk/ë¨4†2É62´:2¨⓪0Ã2⓪34À2Ã0ÀØù╱à╱à"¶0ÀÕ62¨¥╱à⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪69åà⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪69É⑤⑦1åà⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪69É⑥À⓪0¥.20´0«⑤⑦10Œåà⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪69É⑥ãÀ⓪1¥╱à╱à)ØØÉ0À9Ã¥⓪24¨⑥⓪1Ø⑥⓪294†2û⓪8;Ø╱à.åà-åà&íá¬╱à)¶¨´2ÀÉ⑨⓪7Õ2¨0´4Ã3É2Ã;4¨7Ã6ØÃ:⓪⓪⓪*¨Ø¨③¨É#´œØ2É⑥É$Ã:2¨70À⓪!ÃÀÀãÃ29É⓪⓪⓪⓪⓪6õã´╱à⑥ûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûåà╱à!ÃÀÀãÃ2⓪⓪⓪       mcat
  1594. Syntax           mcat <macro> <string>
  1595.  
  1596. The mcat command will append a string to the end of a macro or variable,
  1597. and reassigns the resulting string to the macro or variable. An example
  1598. use of thh⇦OéÃ⓪0Ã⓪<9À⓪897õØØ:¨2É4¨É9œ7†Ã⓪12À7†¥╱à╱à⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⑤⓪$Ã8:´⓪3:À6⓪70ÀØåà⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪4Ã8:´⓪②œÃ4´4ãÀ9É①"Ã:2¨⓪4Ã4´4ãÀ9ƒ①╱à⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪4Ã8:´⓪②¨´¨70ÀØÉ①"Ã:2¨⓪9´¨70À؃①╱à⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪9Ø´⓪②Ã0ÀØßÆœÃ4´4ãÀ9åà⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪6õã´⓪②Ã0ÀØÉ②¨´¨70ÀØåà⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪2¶4´╱à╱à"¶0ÀÕ62¨¥╱à⓪⓪⓪⓪⓪⓪⓪⓪⓪        mcat %fred "abc"
  1599.                  mcat %fred %bill
  1600.  
  1601. See also: set, unset, mkill
  1602. ]
  1603. [
  1604. MKDIR
  1605. System 2 operating environment   User's Guide - Internal Commands     mkdir
  1606. -------------- @FûÉ #KH⓪①Ññ✓✓פפ⇦⇦⇦⇦⇦⇦⇦⇦⇦⇦⇦⇦⇦⇦⇦⇦⇦⇦⇦⇦⇦⇦⇦⇦⇦⇦⇦⇦⇦⇦⇦⇦⇦⇦⇦⇦⇦⇦⇦⇦⇦⇦⇦⇦◆◆◆    ijα✓£ⁿⁿⁿⁿⁿⁿⁿⁿⁿ°ÿ O◆✓@ ✓⑧α<ⁿⁿⁿⁿⁿⁿⁿⁿⁿⁿ°ÿ Lⁿ⑧@זÿ HÇij⑧H$◆◆✓⑧8ä°ÿ L°ijα✓£°ijHÇα⑧ÇD°Σ°✓Ç⇦°@זÿ HÇij⑧H$° °⑧8ä°ÿ @⇦° ⑧<°⑧8ä°Ç ✓Ç◆✓✓αä ∙ז$°ÿÇêα⑧°⑧8ä°ÿ HÇij⑧H$° D°ijHÇα⑧Ç£° ⑧8  °⑧8ä°ijHHÇ✓°ÿ HÇij⑧H$◆✓⑧8 D° D°@  ⑧αL°⑧⇦°ij8@ ✓äⁿüijHÇα⑧ä∙✓Ç Folder' under the GEM desktop.
  1607.  
  1608. Examples
  1609.                  mkdir user
  1610.                  mkdir b:\database\files.dat
  1611.  
  1612. See also: cd, rmdir
  1613. ]
  1614. [
  1615. MKILL
  1616. System 2 operating environment   User's Guide - Internal Commands     mkill
  1617. ---------------------------------------------------------------------------
  1618.  
  1619. Command          mkill
  1620. Syntax           mkill
  1621.  
  1622. The mkill command will remove all macros and variables. It is equivalent
  1623. to using unset on each individual macro or variable
  1624.  
  1625. Example:
  1626.                  mkill
  1627.  
  1628. See also: unset, set, mcat
  1629. ]
  1630. [
  1631. MV
  1632. System 2 operating environment   User's Guide - Internal Commands        mv
  1633. ---------------------------------------------------------------------------
  1634.  
  1635. Command          mv
  1636. Syntax           mv <oldfilename> <newfilename>
  1637.  
  1638. The mv command (standing for move) allows files to be renamed. The
  1639. specified file <oldfilename> is given the name <newfilename>. The contents
  1640. of the file remain unchanged. No wildcards are allowed.
  1641.  
  1642. Examples:
  1643.                  mv fred.wp fred.doc
  1644.                  mv thing.tmp prog.c
  1645.  
  1646. Notes:
  1647.  
  1648. Files cannot be renamed across physical devices (ie disk drives), so the
  1649. command mv a:fred.doc b:fred.doc would not be valid. This command is
  1650. exactly equivalent to ren.
  1651.  
  1652. See also: ren, cp 
  1653. ]
  1654. [
  1655. NOTEQUAL
  1656. System 2 operating environment   User's Guide - Internal Commands  notequal
  1657. ---------------------------------------------------------------------------
  1658.  
  1659. Command          notequal
  1660. Syntax           notequal <string1> <string2>
  1661.  
  1662.  
  1663. The notequal command returns a value of false (-1) if <string2> is the same
  1664. as <string1>, or true (0) if it isn't. It is intended for use with the if
  1665. command, for example,
  1666.  
  1667.        if notequal %birdname "puffin" ; echo "Not puffin" ; echo ; endif
  1668.  
  1669. would print 'Not puffin' on the screen if the variable %birdname was not
  1670. equal to the string 'puffin'. All tests are case sensitive.
  1671.  
  1672. Examples:
  1673.  
  1674.   notequal "fred" "fred"                             returns -1
  1675.   notequal "Fred" "fred"                             returns 0
  1676.   notequal "fred" fred                               returns 0
  1677.   notequal "fred" "james"                            returns -1
  1678.   notequal fred fred                                 returns -1
  1679.  
  1680. Notes:
  1681.  
  1682. All tests are case sensitive, so "FRED" will not match 'Fred','fred', etc.
  1683.  
  1684. See also: equal, contains, istrue
  1685. ]
  1686. [
  1687. PATH
  1688. System 2 operating environment   User's Guide - Internal Commands      path
  1689. ---------------------------------------------------------------------------
  1690.  
  1691. Command          path
  1692. Syntax           path [<pathname>]
  1693.  
  1694. The path command changes the default directory for executable programs (such
  1695. as bombs) to the given pathname. For example, if you had a utility fred.ttp
  1696. in subdirectory \bin, then after typing
  1697.  
  1698.                  path \bin
  1699.  
  1700. you could just type
  1701.  
  1702.                  fred
  1703.  
  1704. to execute the program, instead of
  1705.  
  1706.                  \bin\fred
  1707.  
  1708. Note that if any colons(:) or backslashes (\) appear in the program name when
  1709. typed in to be executed, the default pathname will be overridden
  1710.  
  1711. See also: pwd
  1712. ]
  1713. [
  1714. PR
  1715. System 2 operating environment   User's Guide - Internal Commands        pr
  1716. ---------------------------------------------------------------------------
  1717.  
  1718. Command          pr
  1719. Syntax           pr [-[l<x>s<x>i<x>t] [<title>]] [<filespec>]
  1720.  
  1721. pr is a flexible command that allows a text file to be formatted. The
  1722. output is of a form particularly suitable for printing. The filespec
  1723. consists of a filename which can contain wildcards. There are four
  1724. qualifiers which can be specified, details of which are given below.
  1725. The output is by default to standard output.
  1726.  
  1727.     l       The number following this qualifier specifies the length
  1728.             of a page of output, which is used by the s qualifier. The
  1729.             default is 66. The length is given in printed lines.
  1730.     s       The number following the s qualifier specifies the number
  1731.             of lines that are to be left blank at the end of each page
  1732.             (for instance to skip over a page break). The default is 0.
  1733.     i       The number following the i qualifier specifies the number
  1734.             of spaces that are to be output before each line of text,
  1735.             ie the left margin indent. The default is 0.
  1736.     t       Specifies that a title & page numbers are to be printed.
  1737.             If this qualifier is given, then the <title> parameter
  1738.             must be specified, which is the title.
  1739.  
  1740. Examples:
  1741.  
  1742.    pr fred.dat                              The same as cat fred.dat
  1743.    pr -i5 fred.dat                          Show fred.dat with a left
  1744.                                             margin of 5 spaces.
  1745.    pr -l70s10i15 fred.dat                   Show fred.dat with a left
  1746.                                             margin of 15 spaces, and
  1747.                                             use a page length of 70
  1748.                                             lines, missing the last 10
  1749.                                             lines on each page.
  1750.    pr -l60s5t "Data file" fred.dat          Show fred.dat on the screen
  1751.                                             and use a page length of 60
  1752.                                             lines, skipping 5 lines at
  1753.                                             the end of each page, and
  1754.                                             putting the title "Data file"
  1755.                                             & the page number at the top
  1756.                                             of each page.
  1757.    pr -l60s5t "Data file" fred.dat > prn:   As above, but send to the
  1758.                                             printer
  1759.    help index | pr -l70s10                  Pipes output of help into
  1760.                                             pr for formatting.
  1761.  
  1762. Notes:
  1763.  
  1764. pr cannot accept input from the keyboard like cat, since it is line
  1765. orientated.
  1766.  
  1767. See also: cat, type
  1768. ]
  1769. [
  1770. PUTC
  1771. System 2 operating environment   User's Guide - Internal Commands      putc
  1772. ---------------------------------------------------------------------------
  1773.  
  1774. Command          putc
  1775. Syntax           putc <n> [<n> <n> ...]
  1776.  
  1777. The putc command translates the given number(s), which should be in the range
  1778. 0-255, into their ASCII character equivalents, which are then sent to the
  1779. standard output. For example,
  1780.  
  1781.                  putc 72 69 76 76 79
  1782.  
  1783. displays HELLO on the screen, since ASCII 72='H', ASCII 69='E', etc.
  1784.  
  1785. One major application of putc is in the writing of control codes. For example,
  1786. in order to be put into emphasised text mode, most Epson compatible printers
  1787. need to be sent a sequence of control codes as ASCII characters, namely
  1788. character 27 followed by character 69 (ESC E). So, to put your printer into
  1789. emphasised mode, you could type
  1790.  
  1791.                  putc 27 69 > prn:
  1792.  
  1793. See also: getc, echo, cat, pr
  1794. ]
  1795. [
  1796. PWD
  1797. System 2 operating environment   User's Guide - Internal Commands       pwd
  1798. ---------------------------------------------------------------------------
  1799.  
  1800. Command          pwd
  1801. Syntax           pwd
  1802.  
  1803. The pwd command displays the letter of the current disk drive, and the
  1804. current subdirectory that you are in. It basically reminds you which
  1805. subdirectory you are in, if any.
  1806.  
  1807. Example session:
  1808.  
  1809. $ pwd
  1810. Current directory path is A:\
  1811. $ drive b
  1812. $ pwd
  1813. Current directory path is B:\
  1814. $ cd bin
  1815. $ pwd
  1816. Current directory path is B:\BIN\
  1817.  
  1818. Notes:
  1819.  
  1820. pwd is a 'Unixism', and stands for print working directory.
  1821.  
  1822. See also: cd, drive
  1823. ]
  1824. [
  1825. QUIT
  1826. System 2 operating environment   User's Guide - Internal Commands      quit
  1827. ---------------------------------------------------------------------------
  1828.  
  1829. Command          quit
  1830. Syntax           quit
  1831.  
  1832. The quit command will restore the colours to their values before System2
  1833. was started, and will return to the desktop or calling program
  1834.  
  1835. Example:
  1836.                  quit
  1837. ]
  1838. [
  1839. REN
  1840. System 2 operating environment   User's Guide - Internal Commands       ren
  1841. ---------------------------------------------------------------------------
  1842.  
  1843. Command          ren
  1844. Syntax           ren <oldfilename> <newfilename>
  1845.  
  1846. The ren command allows files to be renamed. The specified file
  1847. <oldfilename> is given the name <newfilename>. The contents of the file
  1848. remain unchanged. No wildcards are allowed.
  1849.  
  1850. Examples:
  1851.                  ren fred.wp fred.doc
  1852.                  ren thing.tmp prog.c
  1853.  
  1854. Notes:
  1855.  
  1856. Files cannot be renamed across physical devices (ie disk drives), so the
  1857. command ren a:fred.doc b:fred.doc would not be valid. This command is
  1858. exactly equivalent to mv.
  1859.  
  1860. See also: mv, cp 
  1861. ]
  1862. [
  1863. RESULT
  1864. System 2 operating environment   User's Guide - Internal Commands    result
  1865. ---------------------------------------------------------------------------
  1866.  
  1867. Command          result
  1868. Syntax           result
  1869.  
  1870. The result command displays on the standard output the value returned by
  1871. the last command executed.System2 commands usually return 0 or more
  1872. to mean successful completion, -1 to mean error, and -2 to mean that a
  1873. syntax message was output.
  1874.  
  1875. Example:
  1876.                  result
  1877.  
  1878. Notes:
  1879.  
  1880. This command is equivalent to typing echo %result.
  1881. ]
  1882. [
  1883. RM
  1884. System 2 operating environment   User's Guide - Internal Commands        rm
  1885. ---------------------------------------------------------------------------
  1886.  
  1887. Command          rm
  1888. Syntax           rm <filespec>
  1889.  
  1890. This command is used to remove disk files that are no longer needed. A
  1891. removed file CANNOT BE RECOVERED.
  1892.  
  1893. The filespec parameter can be a single filename, in which case the given
  1894. file is deleted, or a wildcard, in which case all files that match the
  1895. specification are deleted.
  1896.  
  1897. Obviously, this command must be used with great care. If you wish, the
  1898. command DEL can be used in place of RM.
  1899.  
  1900. Examples:
  1901.                  rm fred.doc
  1902.                  rm *.c
  1903.  
  1904. See also: del, rmdir
  1905. ]
  1906. [
  1907. RMDIR
  1908. System 2 operating environment   User's Guide - Internal Commands     rmdir
  1909. ---------------------------------------------------------------------------
  1910.  
  1911. Command          rmdir
  1912. Syntax           rmdir <subdirectory>
  1913.  
  1914. The rmdir command removes an empty subdirectory from the disk. To delete a
  1915. subdirectory with files in it, the files within the subdirectory must first
  1916. be removed (using the rm command) before the rmdir command is issued.
  1917.  
  1918. Examples:
  1919.  
  1920.                  rmdir documents
  1921.                  rmdir source\c_code
  1922.  
  1923. See also: cd, mkdir, rm
  1924. ]
  1925. [
  1926. SET
  1927. System 2 operating environment   User's Guide - Internal Commands       set 
  1928. ---------------------------------------------------------------------------
  1929.  
  1930. Command          set
  1931. Syntax           set [<macro>[ = | : ][<value]]
  1932.  
  1933. The set command controls the assigning of variables and macros, and is a
  1934. fairly complex command.
  1935. If issued without any parameters, set will respond with a list of the
  1936. current values of all system variables, followed by a list of all macros
  1937. and user defined variables if any exist.
  1938.  
  1939. Set allows values to be assigned to either system variables, macros or
  1940. user defined variables. The single parameter consists of a variable name,
  1941. followed by an = or a : , then the value that the variable is to take.
  1942. If the separator is an = sign, then an attempt will be made to evaluate
  1943. the value to a numeric expression (see eval), so, for example, 3*6 would
  1944. yield a value of 18. However, if the separator is a colon (:), the
  1945. value will be interpreted as a direct string, so 3*6 would yield a value
  1946. of "3*6". If a value is being assigned to a system variable, then the
  1947. separator type is arbitrary: the value is interpreted according to the
  1948. sort of value the system variable holds.
  1949.  
  1950. If no value is given, then the specified macro or variable is de-assigned,
  1951. as with the unset command.
  1952.  
  1953. Examples:
  1954.  
  1955.   set                                   Produces a list of variables
  1956.   set edit:"a:\bin\me"                  Make macro edit equal to the string
  1957.                                         "a:\bin\me"
  1958.   set %fred=%age+20                     Makes variable %fred with a value
  1959.                                         20 more than the value of %age
  1960.   set %fred:"%age+20"                   Makes variable %fred equivalent to
  1961.                                         the string "%age+20"
  1962.   set %fred=                            De-assign variable %fred
  1963.  
  1964. Notes:
  1965.  
  1966. There must be no spaces around the = or : sign. 
  1967.  
  1968. See also: unset, mcat, mkill,incr, decr, eval
  1969. ]
  1970. [
  1971. TIME
  1972. System 2 operating environment   User's Guide - Internal Commands      time
  1973. ---------------------------------------------------------------------------
  1974.  
  1975. Command          time
  1976. Syntax           time [<hh> <mm> <ss>]
  1977.  
  1978. The time command will display the current time, or will allow the time to
  1979. be set if the three parameters (corresponding to hours, minutes, seconds)
  1980. are supplied. The hours are given in 24 hour format (0-23)
  1981.  
  1982.  
  1983. Examples:
  1984.                  time
  1985.                  time 7 41 30
  1986.                  time 23 31 28
  1987.  
  1988. See also: date
  1989. ]
  1990. [
  1991. TRUE
  1992. System 2 operating environment   User's Guide - Internal Commands      true
  1993. ---------------------------------------------------------------------------
  1994.  
  1995. Command          true
  1996. Syntax           true
  1997.  
  1998. This command returns the value true (0).
  1999.  
  2000. See also: false
  2001. ]
  2002. [
  2003. TYPE
  2004. System 2 operating environment   User's Guide - Internal Commands      type
  2005. ---------------------------------------------------------------------------
  2006.  
  2007. Command          type
  2008. Syntax           type <filename1> [<filename2> ... ]
  2009.  
  2010. The type command displays the contents of each disk file specified. The
  2011. filenames cannot contain any wildcards.
  2012.  
  2013. Examples:
  2014.                  type customer.rec
  2015.                  type test1.c test2.c test3.c
  2016.                  type test4.c > prn:
  2017.  
  2018.  
  2019. Notes:
  2020.  
  2021. Pressing CONTROL S and CONTROL Q during displaying a file on the screen will
  2022. cause the screen to freeze and be released, enabling text to be viewed
  2023. before it scrolls off the screen. Do not press CONTROL C during output, or
  2024. else you may be aborted to the desktop.
  2025.  
  2026. See also: cat, pr
  2027. ]
  2028. [
  2029. UNSET
  2030. System 2 operating environment   User's Guide - Internal Commands     unset
  2031. ---------------------------------------------------------------------------
  2032.  
  2033. Command          unset
  2034. Syntax           unset <macro>
  2035.  
  2036. The unset command allows a macro or variable to be disposed of. The contents
  2037. and store are lost.
  2038.  
  2039. Examples:
  2040.                  unset %fred
  2041.                  unset edit
  2042.  
  2043. Notes:
  2044.  
  2045. System variables cannot be unset
  2046.  
  2047. See also: mkill, set
  2048. ]
  2049. [
  2050. XSL
  2051. System 2 operating environment   User's Guide - Internal Commands       xsl
  2052. ---------------------------------------------------------------------------
  2053.  
  2054. Command          xsl
  2055. Syntax           xsl <filename> [<param1> ... <param9>]
  2056.  
  2057. The xsl command will execute an xsl program with the given filename. The
  2058. file must have the extension .XSL. The optional parameters are passed
  2059. to the program as variables %1 to %9. There can be between 0 and 9
  2060. parameters, the number of which is stored in a temporary variable %argc.
  2061.  
  2062. Examples:
  2063.  
  2064.                  xsl dobackup
  2065.                  xsl deldir cprogs.c
  2066.                  xsl newecho "ABC" 123 ABC123 %fred
  2067.  
  2068. Notes:
  2069.  
  2070. This command is exactly equivalent to $. This command cannot be used
  2071. within an XSL program.
  2072.  
  2073.  
  2074. See also: $
  2075. ]
  2076. [
  2077. .
  2078. System 2 operating environment   User's Guide - Internal Commands         .
  2079. ---------------------------------------------------------------------------
  2080.  
  2081. Command          .
  2082. Syntax           . <label>
  2083.  
  2084. The . command is followed by a label which is used by the goto command
  2085. in xsl programs. See goto for more details.
  2086.  
  2087. Examples:
  2088.                  . loop
  2089.                  . do_exit
  2090.  
  2091. See also: goto, xsl
  2092. ]
  2093. [
  2094. $
  2095. System 2 operating environment   User's Guide - Internal Commands         $
  2096. ---------------------------------------------------------------------------
  2097.  
  2098. Command          $
  2099. Syntax           $ <filename> [<param1> ... <param9>]
  2100.  
  2101. The $ command will execute an xsl program with the given filename. The
  2102. file must have the extension .XSL. The optional parameters are passed
  2103. to the program as variables %1 to %9. There can be between 0 and 9
  2104. parameters, the number of which is stored in a temporary variable %argc.
  2105.  
  2106. Examples:
  2107.  
  2108.