home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / utility / 205 / docs / gulam.doc next >
Encoding:
Text File  |  1988-09-09  |  72.1 KB  |  1,974 lines

  1. Info file gulam.info, produced by texinfo-format-buffer   -*-Text-*-
  2. from file gulam.tex
  3.  
  4.  
  5.  
  6. File: gulam.info  Node: top, Up: (DIR), Next: usage
  7.  
  8. Introduction
  9. ============
  10.  
  11. *Gulam* is a shell (i.e., a command line interpreter) for AtariST
  12. computers.  It contains some 60+ built-in commands, provides file name
  13. completion a la *TENEX*, has history, alias and rehash
  14. facilities, and integrates the shell with microEmacs easing the
  15. editing of commands being issued.  Among the built-in commands are
  16.  
  17. `egrep'     
  18.      a regular expression based string  pattern  finder.
  19. `te'     
  20.      a simple terminal emulator.
  21. `rx/sx'     
  22.      Xmodem  file  transfers
  23. `pr'     
  24.      a text file printer with pagination.
  25.  
  26. In common usage, it resembles *csh* of *Unix 4.xBSD*;
  27. Gulam's control structures, lexical conventions and other details are,
  28. however, quite different from csh.  While I have borrowed ideas from
  29. other shells (such as Korn shell), I made no heroic attempts to be
  30. compatible with any.  Where possible, I have tried to make
  31. *Gulam* less `surprising' in what it does.
  32.  
  33. The word *Gulam* is pronounced as *Gulaam* in Hindi/Urdu,
  34. and means an obedient servant.
  35.  
  36. *Gulam* is a free program; you are encouraged to give it to others,
  37. but at no cost.  However, the source is copyrighted (i.e., it is not in the
  38. public domain) and will be part of a book on systems programming I am
  39. writing.  The source is available on request, with the usual provisos
  40. regarding material in manuscript form.  This manual is written in the
  41. *TeXinfo* format (the *GNU* documentation format); a laser-printed
  42. TeX-typeset copy of this 40-page manual is also available at cost ($2.00).
  43.  
  44. I am advised to include a disclaimer because there are unreasonable people
  45. out there.
  46.  
  47. "I make no warranty with respect to this manual, or the program it
  48. describes, and disclaim any implied/explicit suggestions of usefulness for
  49. any particular purpose.  Use this program only if you are willing to assume
  50. all risks, and damages, if any, arising as a result, even if it is caused
  51. by negligence or other fault."
  52.  
  53. The first release of this program did contain bugs.  The present
  54. beta-version (dated Sept 1987) is a result of fixing 15 bugs, 9 internal
  55. code improvements (about 180 lines of rewriting), 9 user-visible
  56. improvements.  I am sure this version too has bugs, and undesirable
  57. features.  Users are encouraged to tell me both good and bad things about
  58. this program.
  59.  
  60.  
  61. Many thanks to: Jwahar R.  Bammi for help in every aspect during the
  62. writing of the shell and this manual, and demanding that
  63. *Gulam* be a `reasonably full fledged' shell; David Conroy for
  64. writing a `small is beautiful' microEmacs; Henry Spencer for the
  65. regexp(3) package that is now built into *Gulam*; AtariST for
  66. its value to price ratio.  The program was developed using Megamax and
  67. Mark Williams C compilers.  It now uses my own malloc.c.
  68.  
  69.  
  70.  
  71. Comments on the Present Implementation
  72. ======================================
  73.  
  74. I find the present implementation eminently useable, and indeed use it
  75. all the time, in preference to other shells.
  76.  
  77. Here are some features that I (still) find unsatisfactory.  Control
  78. structures are quite ad-hoc, and incomplete.  I had a tough time in
  79. decreeing that the typical `+-*/()[]{}' are not delimiters; but
  80. that decision made *Gulam* smaller.
  81.  
  82. Here is a list (complete?) of things new and/or diffrent from the
  83. alpha-version.
  84.  
  85.   1. the bugs causing memory-lossage have been fixed.
  86.   2. an application program can now call one of *Gulam*'s routines
  87.      that is equivalent to system() call.
  88.   3. an application program can now call one of *Gulam*'s routines
  89.      that can receive keyboard input from the user, with all the facilities of
  90.      `ue', and return the line input by the user.
  91.   4. `ue' can now insert-file.
  92.   5. stdout append-redirection (`>>') is now implemented.
  93.   6. a new sub-word consisting of three dots `...' expands to the list
  94.      of all filenames rooted at the current or given directory.
  95.   7. doing a `set path <path-list>' will also cause an automatic
  96.      `setenv PATH <path-list> ; rehash'.
  97.   8. `ue' can now fill-paragraph.
  98.   9. new shell variable `verbosity' controls how silent *Gulam* is.
  99.  10. cp will not copy directories and their contents unless
  100.      given the `-r' flag.
  101.  11. `ue' can now use mouse movements as cursor
  102.      movements (see mscursor).
  103.  12. diskettes can be formatted (single/double-sided) in TOS standard way.
  104.  13. the command mem can not only report the GEMDOS free-list but also the list
  105.      of GEMDOS Malloc-ated chunks.
  106.  14. shaded background on the screen is provided for the `gem' command.
  107.  15. the keypad keys can be toggled to become numeric
  108.      or extra-function keys.
  109.  16. there are 3 separate key-bindings for the one *gulam* buffer, and
  110.      the one *mini* buffer, and all the regular buffers.
  111.  
  112.  
  113. File: gulam.info  Node: usage, Prev: top, Up: top, Next: lexical-conventions
  114.  
  115. General Usage
  116. =============
  117.  
  118. The syntactic details of individual commands, and the specific rules that
  119. are followed in evaluating them are given later.  This section is an
  120. overview of how the integration of `ue' with a shell is used.
  121.  
  122. The moment you enter *Gulam*, you are in a ue-buffer
  123. called *mini*.  Thus, all the typical `ue' text-editing
  124. functions are available, except commands such as `Visit-file',
  125. `Switch-to-buffer', etc.  The `RETURN' key causes the entire
  126. line (on which the return is typed) to be evaluated.  The output, if
  127. any, of the command you issued appears on the screen but does not
  128. enter any ue-buffer.  The built-in command `ue' (without any
  129. arguments) takes you into the special ue-buffer named *gulam*;
  130. the output of (built-in) commands issued while you are in *gulam*
  131. does enter that buffer, which can be freely edited.  The command
  132. `ue' FILENAME will read-in each of the named files into
  133. their ue-buffers.  From within `ue', you can
  134. `Switch-to-Gulam-buffer' (whose default binding is `ESC-g').
  135.  
  136. To conserve/manage memory, we release all `ue' buffers when `ue'
  137. is exited in the usual way (i.e., `UNDO', or `^X-^C');
  138. exiting temporarily via the `^Z' does not release memory.
  139. Issuing a substantial number of commands through the *mini* buffer,
  140. without entering `ue' in between, will accumulate all the commands
  141. (but not their output) in the *mini* buffer, and soon there will be a
  142. memory shortage.  To prevent this, enter and exit `ue' once in a
  143. while, or delete (using `^D', or `Delete') characters in the
  144. *mini* buffer.
  145.  
  146.  
  147.  
  148.  
  149. File: gulam.info  Node: lexical-conventions, Prev: usage, Up: top, Next: command-processing
  150.  
  151. Lexical Conventions
  152. ===================
  153.  
  154. All  input  to  *Gulam*  is  case-sensitive; on the other hand, TOS
  155. file names are case-independent.  
  156.  
  157. The  evaluation  of  the command line  begins by dividing it into
  158. "words" and "subwords".  The "word-delimiters" are
  159. space, tab, return, line-feed (the so-called white chars),
  160. single-quote, double-quote, semicolon, and the vertical-bar.
  161.  
  162.  
  163. Note that  `+-*=/()[]{}' etc. are *not* "word-delimiters".  A
  164. "word"  is  either
  165.  
  166.    * A  sequence  of  chars  not containing any "word-delimiters".
  167.    * A  string  of  arbitrary chars enclosed in single/double-quotes.
  168.    * A `semicolon'.
  169.    * A `vertical-bar'.  
  170.  
  171. Eg,  the lines below 
  172.  
  173.      date  01-22-87-22:08:34  #sets the TOS and ikbd date-time
  174.      alias c 'mmcc e:\gulam\$1.c; cp e:\gulam\$1.o .'
  175.      if    {$x + $y ==23 }
  176.      if    { -e $1.c }
  177.  
  178. would be divided into the words (shown between slashes) 
  179.  
  180.      /date/01-22-87-22:08:34/#sets/the/TOS/and/ikbd/date-time/
  181.      /alias/c/'mmcc e:\gulam\$1.c; cp e:\gulam\$1.o .'/
  182.      /if/{$x/+/$y/==23/}/
  183.      /if/{/-e/$1.c/}/
  184.  
  185. "Comments" begin  with  a  word  whose first char is `#', and
  186. end  at  the  end  of line.  A `#' embedded in the middle of a word
  187. does not begin a comment.  
  188.  
  189. The "subword-delimiters" are the characters in 
  190. `!@#$%^&-=+`~{}:;'"\|,.<>/'.
  191.  
  192.  
  193. File: gulam.info  Node: command-processing, Prev: lexical-conventions, Up: top, Next: batch-files
  194.  
  195. Outline of Command Processing
  196. =============================
  197.  
  198. The command line is string pre-processed as described below before invoking
  199. it as a command.
  200.  
  201.    * History substitutions occur first.
  202.    * Dollar substitutions, wiggle  expansion,  meta  expansions  occur second.
  203.    * Split the resulting  line  into semi-colon separated commands.
  204.    * For each command,  alias  expand  it,  and  dollar-substitute.
  205.    * Execute each resulting command.  
  206.  
  207.  
  208. File: gulam.info  Node: batch-files, Prev: command-processing, Up: top, Next: buffers
  209.  
  210. Batch Files
  211. ===========
  212.  
  213. A "batch file", also called a shell file, is a text file containing
  214. *Gulam* commands, both internal and external.  Such files must have
  215. the extension `.g' for them to be recognized as commands.  See the
  216. section on `gulam.g' for an example shell file.
  217.  
  218. In processing these files *Gulam* uses `ue' buffers.  So, if
  219. you have `ue' as a command in a batch file, and then exit `ue'
  220. with either `UNDO' or `^X-^C', all the buffers
  221. (including the one holding the batch file) will be released, and
  222. *Gulam* will surely crash. So, do *NOT* include `ue' as a
  223. command in a shell file.
  224.  
  225. Redirections to/from batch files do not work properly.
  226.  
  227.  
  228. File: gulam.info  Node: buffers, Prev: batch-files, Up: top, Next: command-line-editing
  229.  
  230. Buffers: Gulam, Mini and Regular Buffers
  231. ========================================
  232.  
  233. Once you invoke *Gulam*, you are always in one of the microEmacs
  234. (*uE*) "buffers" which are reservoirs of text.  In this program, a
  235. typical line-oriented command shell is integrated with microEmacs.  This
  236. necessitated two special kinds of buffers, named *gulam* and
  237. *mini*, along with the regular buffers.
  238.  
  239. Right after you invoke *Gulam*, you are in *mini*, and each
  240. line you type is taken as a *Gulam* command, and executed.  Any
  241. output produced by such a command is displayed on the screen but not
  242. entered into any microEmacs buffer.  Should you desire to capture such
  243. output into a buffer, enter the *gulam* buffer by typing `ue'
  244. without any arguments.  If you are editing in a regular buffer elsewhere in
  245. microEmacs, pressing `ESC-g' (see `kb' below for
  246. `switch-to-Gulam-buffer') will get you into *gulam*.
  247.  
  248. While you are in *Gulam*, the `RETURN' key behaves as it does in
  249. *mini*.  All command input, including giving the names of buffers
  250. within `ue', takes place in *mini*.  The window for this buffer
  251. is always at the bottom of screen, and usually only one-line high.  (Some
  252. of you may want to experiment with `^X-^Z' and
  253. `^X-z'.) You enter the *mini* either because (A) you are
  254. outside the normal microEmacs, or (B) a command such as
  255. `Switch-to-buffer' wants to read your input.  The *mini* is like
  256. any other buffer except for the bindings of a few keys, and the disallowing
  257. of `ue' functions that change/switch buffers/windows/files.  One of
  258. these exceptional keys (in *mini*) is the `RETURN' key: it will
  259. submit the entire line -- even if the cursor was somewhere in the middle of
  260. the line-- to the shell (case A), or to such `ue' commands as
  261. `Visit-File' (case B).  Until you press `RETURN', you can edit not
  262. only that line but others in *mini* just as you would in regular
  263. buffers.
  264.  
  265. Note that unless you occasionally exit microEmacs with
  266. `^X-^C' or `UNDO', both *gulam* and *mini*
  267. buffers will keep growing, and you may run out of memory.
  268.  
  269.  
  270. File: gulam.info  Node: command-line-editing, Prev: buffers, Up: top, Next: invoking-gulam
  271.  
  272. Command Line Editing
  273. ====================
  274.  
  275. Full microEmacs editing is available while typing the command.  Thus, you
  276. can transopse chars by `^T', and go to the beginning of the line
  277. by `^A', and ^Yank in a perviously deleted word, etc.
  278.  
  279. In addition to these, there are three convenience features.  After typing
  280. the first few chars of a file name, if you press the key marked
  281. `INSERT', *Gulam* will attempt to complete the file name;
  282. pressing `CLR/HOME' will show all possible completions.  Secondly, if
  283. you type `!n' and then press `INSERT', you will see that the
  284. history-expanded result is brought into the buffer, which can then be
  285. further edited if necessary.  Thirdly, pressing the `DOWNARROW' key
  286. will cycle you through the previous commands.
  287.  
  288.  
  289.  
  290. File: gulam.info  Node: invoking-gulam, Prev: command-line-editing, Up: top, Next: Glossary
  291.  
  292. Invoking Gulam
  293. ==============
  294.  
  295. *Gulam* can be used in four ways.  Two of these four use `TOS'
  296. variable named `_shell_p' (at `0x04f6L').  This (supposedly)
  297. contains a pointer to a routine that takes a string as an argument and
  298. executes it as a shell command.  *Gulam* has slightly extented this.
  299. `*_shell_p', as set by *Gulam*, points the bottom of a (jump)
  300. table, which currently is:
  301.  
  302.              .long   0x86420135        / our magic number
  303.              jmp     getlineviaue_
  304.      togu_:  jmp     callgulam_
  305.  
  306. Thus, `*((long *) 0x04f6L)' == address of `togu_'.  Before
  307. invoking either routine, it always is a good idea to check if the magic
  308. number is present.  Let `mp = *((long *) 0x04f6L) - 12L'.  Then,
  309. `*mp' better be `0x86420135'.
  310.  
  311.   1. The most common usage is as an (outermost) interactive shell.
  312.      Double-click on `gulam.prg'.  Keep your version of `gulam.g' also
  313.      in the same folder.
  314.   2. `int callgulam(p) char *p;' returns the status of executing
  315.      shell command given as a string pointed by `p'.  Let `fp =
  316.      *((long *) 0x04f6L)'.  Then to call this routine, you do `(*fp)(p)'.
  317.   3. `void getlineviaue(p) char *p;' returns in the user-supplied
  318.      array of chars pointed by `p' the command line typed by the user.  Full
  319.      uE editing facilities are available in this inputting process.  `p' must
  320.      point to an array of at least 256 chars; longer input lines cannot be
  321.      given.  The line may contain control characters (inserted by the ^Q
  322.      feature of `ue').  It is ascii NUL terminated.  Let `fp = *((long *)
  323.      0x04f6L) - 6L'.  Then to call this routine, you do `(*fp)(p)'.
  324.   4. For non-interactive use, *Gulam* can be invoked (from shells, from
  325.      application programs via `Pexec()', or `callgulam()') with arguments.
  326.  
  327. `gu 'ls -l' 'echo hello'' is similar to typing the two commands to the
  328. shell in interactive mode.
  329.  
  330. `gu 'pwd' -c scrpt a b c d' does `pwd', and then invokes the
  331. (presumably valid) *Gulam* shell script named `scrpt.g' with
  332. `a b c d' as the script files arguments.  Following the `-c'
  333. must be the name of a batch file.
  334.  
  335. *Gulam* has no other options.
  336.  
  337.  
  338. File: gulam.info  Node: Glossary, Prev: invoking-gulam, Up: top, Next: top
  339.  
  340. Glossary
  341. ========
  342.  
  343.  
  344. File: gulam.info  Node: builtins, Prev: Glossary, Up: Glossary, Next: cd
  345.  
  346.  
  347. Builtin Commands
  348. ----------------
  349.  
  350. A command executed directly by the shell is called a "built-in"
  351. command.  The 62 built-in commands of *Gulam* are:
  352.  
  353.      alias dm     endwhile help    more  printenv set    ue
  354.      cat   dirc   exit     history mson  pushd    setenv unalias
  355.      cd    dirs   fg       if      msoff pwd      source unset
  356.      chmod echo   fgrep    kb      mv    rehash   sx     unsetenv
  357.      copy  egrep  foreach  lpr     peekw ren      te     which
  358.      cp    ef     format   ls      pokew rm       teexit while
  359.      date  endfor gem      mem     popd  rmdir    time
  360.      df    endif  grep     mkdir   print rx       touch
  361.  
  362.  
  363. File: gulam.info  Node: alias, Prev: Glossary, Up: Glossary, Next: cat
  364.  
  365. alias
  366. -----
  367.  
  368. The `alias' built-in command works almost like a shell file but one
  369. that is stored in the internal data structures of *Gulam*.  It often
  370. just specifies a shorter or different name for a command.
  371.  
  372.      alias cc c:\megamax\mmcc.ttp    #1
  373.      unalias cc                      #2
  374.      alias c 'mmcc e:\gulam\$1.c; cp e:\gulam\$1.o .' #3
  375.      alias r  'echo $1.c $1.o; r'    #4
  376.      alias                           #5
  377.      alias g 'echo $3 $1'            #6
  378.      alias cg 'f:\cc.ttp -c -Ie:\gulam -DMWC e:\gulam\$1.c' #7
  379.  
  380. Alias without args (see #5) lists all the aliases that are currently
  381. defined.  The command unalias (see 2) removes the def of an alias.  Line 4
  382. shows a recursive definition; try it out!  If we invoke `g' as in
  383. `g a b c d e f' this is equivalent to `echo c a d e f'; i.e., all
  384. arguments above the highest that was used in a "$-substitution" are
  385. appended to the resulting command string before executing it.
  386.  
  387.  
  388. File: gulam.info  Node: cat, Prev: alias, Up: Glossary, Next: cd
  389.  
  390. cat
  391. ---
  392.  
  393. This command `catenates' files to the standard output (normally screen).
  394. By redirecting output, you can concatenate several files into a combined
  395. file.
  396.  
  397.      cat f1 f2 >f3    # f3 will now equal f1 followed by f2
  398.      cat f1 > prn:    # print the file f1 as is; see also print and lpr
  399.      cat f1        # show it on the screen; use ^S/^Q to stop/go
  400.  
  401.  
  402. File: gulam.info  Node: cd, Prev: cat, Up: Glossary, Next: chmod
  403.  
  404. cd
  405. --
  406.  
  407. The `cd' command changes the current working directory; it also sets
  408. the shell variable named `cwd', the environment variable
  409. named  `CWD'.  If `cd' was given noarguments,  it is equivalent
  410. to `cd $home'.
  411.  
  412.  
  413. File: gulam.info  Node: chmod, Prev: cd, Up: Glossary, Next: cp
  414.  
  415. chmod
  416. -----
  417.      chmod [+-whsvm] FILENAMES
  418.  
  419. `chmod' changes the read/write attributes of the files.  The
  420. `+' flags have inverse effect to the `-' flags.  The `+w'
  421. makes them read-write, and `-w' makes them read-only.  The
  422. `+h' hides the files from directory searches; `+s' marks
  423. them as hidden system files; `-m' turns off the `archived' flag
  424. on the file.
  425.  
  426.  
  427.  
  428. File: gulam.info  Node: cp, Prev: chmod, Up: Glossary, Next: date
  429.  
  430. cp
  431. --
  432.      cp FILENAMES TARGET-DIR
  433.      cp FILENAME1 FILENAME2
  434.  
  435. Copies files.  In the first form, any number of files may be copied into
  436. the destination directory; files in the target dir will have their original
  437. names.  In the second form, only one file is copied, and the new one will
  438. be named filename2.
  439.  
  440.      cp FNM FNM    # will exit with status -1 
  441.      cp -r D1 DIR2     # if d1 is a directory, this command
  442.                    # will create a dir named d1 in dir2, and 
  443.                    # copies all the files in d1 to to dir2\d1 
  444.  
  445. In the second example above, if -r option is omitted, cp will ignore any
  446. directory names in the list of source files.  Use the -r option with
  447. caution.  E.g.,
  448.  
  449.      cp -r d1  d1\d2 # is dangerous 
  450.  
  451. will, assuming that d1\d2 is a directory, copy/create subtree d1 inside d2.
  452. But, the problem is that d1 will keep growing as a result until of course
  453. there is no more room on the target disk!
  454.  
  455. A simple way to print a file as is, instead of using lpr or print, is to
  456.  
  457.      cp fnm prn: 
  458.  
  459. There is a `+t' option that gives the created target files the time
  460. and date of the source files.  If you care about this, you may want to set
  461. up an `alias' as in:
  462.  
  463.      alias cp 'cp +t' 
  464.  
  465.  
  466. $cwd and $CWD
  467. -------------
  468.  
  469. The shell variable named `cwd' (and env var named `CWD') holds the
  470. full path name of the current working directory.  
  471.  
  472.  
  473. File: gulam.info  Node: date, Prev: cp, Up: Glossary, Next: df
  474.  
  475. date
  476. ----
  477.  
  478. The `date' command, without arguments, prints the current date and
  479. time.  With arguments, it sets the date and time.  
  480.  
  481.      date 01-22-87-22:08:34 
  482.  
  483. will set the date to Jan 22, 87 and time to 10:08:34 pm.  Instead of hyphen,
  484. and colon, other delimiters can be used, as long as the whole argument of date
  485. is still one word.
  486.  
  487.  
  488. File: gulam.info  Node: df, Prev: date, Up: Glossary, Next: dm
  489.  
  490. df
  491. --
  492.      df DRIVENAMES
  493.  
  494. `df'  shows the free space on the asked for drive(s); e.g.,
  495.      df a c f
  496.  
  497.  
  498. File: gulam.info  Node: dm, Prev: df, Up: Glossary, Next: dirc
  499.  
  500. dm
  501. --
  502.  
  503. `dm' (drive map) gives a string of letters that stand for the
  504. installed drives.
  505.  
  506.  
  507. File: gulam.info  Node: dirc, Prev: dm, Up: Glossary, Next: dirs
  508.  
  509. dir cache dirc
  510. --------------
  511.  
  512. To help do the Tenex file name completion efficiently, there is a
  513. cache of contents of directories.  `dirc' shows the names of
  514. these dirs, and how many bytes are used by their contents.  Unless you
  515. did a `set dir_cache 1', or you executed commands that only
  516. examine the file system the `dirc' has nothing to show since the
  517. cache is flushed at the end of each command.  Try *Gulam* with
  518. `dir_cache' set to 1.  Note however that this cache is updated
  519. only by commands that change the contents of a directory (such as
  520. `rm', `cp').  A rather annoying result is that even after
  521. you change the diskette in a drive, you may see the directory contents
  522. of the previous diskette listed.  An `UNDO', `dirc -',
  523. `rm' with/without arguments will explicitly flush the cache.
  524.  
  525.  
  526. File: gulam.info  Node: dirs, Prev: dirc, Up: Glossary, Next: echo
  527.  
  528. dirs
  529. ----
  530.  
  531. *Gulam* has an internal stack of directories whose content is
  532. printed by the `dirs' command.  The built-in commands `pushd',
  533. and `popd' are the only others that operate on this stack.
  534.  
  535.  
  536. File: gulam.info  Node: dollar-substitutions, Prev: command-line-editing, Up: top, Next: expressions
  537.  
  538. Dollar-substitutions
  539. --------------------
  540.  
  541. The subword `$x' in a command is substituted by the value of it.  If
  542. `x' is the name of a shell var, or an environment var, then `$x'
  543. is the value of that variable.  If `x' is an unsigned number, it
  544. stands for the x-th argument; thus, `$0' usually gives the command
  545. name.   `$*'  stands  for the text of the entire command; `$-' stands
  546. for  words  `$1'  to dollar-last; `$<' stands for the on-demand input
  547. given by the user.  
  548.  
  549.  
  550.  
  551. Dotg.g
  552. ------
  553.  
  554. -- see Batch Files, and gulam.g 
  555.  
  556.  
  557. File: gulam.info  Node: echo, Prev: dirs, Up: Glossary, Next: ef
  558.  
  559. echo
  560. ----
  561.  
  562. The `echo' command prints its arguments.  
  563.  
  564.      echo c:\mwc\...    # all the fnms in the dir tree rooted at c:\mwc will be echoed
  565.  
  566.  
  567. File: gulam.info  Node: ef, Prev: echo, Up: Glossary, Next: egrep
  568.  
  569. ef
  570. --
  571. -- stands for `elseif'; see `if'
  572.  
  573.  
  574. File: gulam.info  Node: egrep, Prev: ef, Up: Glossary, Next: endif
  575.  
  576. egrep
  577. -----
  578. -- see `grep'
  579.  
  580.  
  581. File: gulam.info  Node: endif, Prev: egrep, Up: Glossary, Next: endfor
  582.  
  583. endif
  584. -----
  585. -- see `if'
  586.  
  587.  
  588. File: gulam.info  Node: endfor, Prev: endif, Up: Glossary, Next: exit
  589.  
  590. endfor
  591. ------
  592. -- see foreach
  593.  
  594.  
  595. Style of Environment String 
  596. ----------------------------
  597.  
  598. This shell var controls the format of the environment string supplied to
  599. the external command invoked through *Gulam*.
  600.  
  601.      set env_style bm # to get a style of env a la MS-DOS
  602.      set env_style mw # Mark Williams
  603.      set env_style gu # the "normal" style, a la Unix
  604.  
  605.  
  606. File: gulam.info  Node: exit, Prev: endfor, Up: Glossary, Next: fg
  607.  
  608. exit
  609. ----
  610.      exit [NUMBER]
  611.  
  612. The `exit' built-in command is used to force termination of a shell
  613. script.
  614.  
  615.  
  616. File: gulam.info  Node: expressions, Prev: dollar-substitutions, Up: top, Next: flags
  617.  
  618. Expressions 
  619. ------------
  620.  
  621. An "atomic exp" is either a NUMBER, a FILENAME, a FILE
  622. PREDICATE, a { EXP }, or ! ATOMIC EXP.
  623.  
  624. A FILE PREDICATE on a file name FNM is of the form `-c
  625. FNM' where `c' is in `{e, f, d, h, v, m}'.  These letters
  626. stand for "exists", "is-a-regular-file", "is-a-dir",
  627. "is-a-hidden-file", "is-a-volume-label", and
  628. "is-an-archived-file".  A FILEPRED yields 1 if it is true, 0
  629. otherwise.
  630.  
  631. An arithmetic expression is constructed using the operators `+-/%*'.
  632. All these are of equal precedence and evaluated left-to-right; thus,
  633. `2 + 4 / 2' is equal to 3.  However, the braces raise the precedence
  634. of the ops within them; thus, `2 + { 6 / 2}' is equal to 5.  An exp
  635. with no operators, i.e., an atom, is a special case because we want the
  636. string form of the atom (e.g., as for `blah' in `set s blah').  A
  637. non-numeric string yields 0 as its numeric value in an arith exp.
  638.  
  639. A "relational expression" is of the form `arithexp relation
  640. arithexp', where relation is any one of `<=, <, ==, !=, >,' or
  641. `>='.  Such a relation yields a 1 if it holds, 0 otherwise.
  642. (Relational operators among strings are not implemented yet.)  You may
  643. combine expressions using the boolean operators `&&' and `||'
  644. (which are not, for now, short-circuit evaluated).
  645.  
  646. Note the spaces in the examples above; see Lexical Structure.  
  647.  
  648.  
  649. File: gulam.info  Node: fg, Prev: exit, Up: Glossary, Next: file-names
  650.  
  651. fg
  652. --
  653.  
  654. `fg' is part of the simulation of what we were used to doing on Unix
  655. with GNU-Emacs: get out of it by stopping GNU (`^Z' in ue/Gulam),
  656. do a few shell commands and get back in by `fg' (works the same in
  657. ue/Gulam).
  658.  
  659.  
  660.  
  661. File: gulam.info  Node: file-names, Prev: fg, Up: Glossary, Next: foreach
  662.  
  663. File Names
  664. ----------
  665.  
  666. There are many conveniences in *Gulam* that relate to specifying
  667. filenames.  It can complete a file name given its first few characters.
  668. (Tenex is widely considered to be the first OS to implement this.) Type the
  669. first few characters, and then press the key marked `INSERT' (or
  670. `CLR/HOME'), while you are in *mini*.  If you are in buffer
  671. *gulam*, use `ESC' `ESC' (2 escapes).
  672.  
  673. The canonical form of the full path name of a file begins with a letter
  674. designating the disk drive, followed by a colon, a back-slash separated
  675. list of identifiers.  All but the last of these identifiers must be a
  676. directory name.  In the non-standard form, you may also use a dot `.', and
  677. dot-dot `..' in place of the identifiers in appropriate contexts.  Whenever
  678. *Gulam* completes your filenames, it will produce the standard form
  679. full path names.
  680.  
  681. *Gulam* will standardize, in three situations, non-standard form of
  682. a `path', as shown in the example below.  These situations are:
  683.   1. Tenex file name expansion is invoked.
  684.   2. the word contains meta characters.
  685.   3. the name is being given to one of the file operations in `ue'.
  686.  
  687. `e:\gulam\a:\lex.c' is standardized to `a:\lex.c'
  688. `e:\gulam\\src\util.c' is standardized to `c:\src\util.c'
  689. `e:\gulam\~\ex.o' is standardized to `d:\bin\ex.c'
  690.  
  691. assuming that the current drive was `c:\', and home was `d:\bin', and
  692. variable `parent_expand' is set.  This is especially nice inside
  693. `ue' when visiting other files.
  694.  
  695. Words, as given by the you, that contain meta characters (which are
  696. `*?|()[]') or the string `...' are expanded.  In general, one
  697. such word produces a list of file names.  These file name regular
  698. expressions (fnmre) are like regular expressions (re), but have different
  699. semantics.  Occurrences of an fnmre, outside of strings, are replaced by
  700. the sorted blank-separated list of file names matching the fnmre.  An fnmre
  701. differs from re in (1) `.' stands for itself; (2) `*' is matches zero or
  702. more arbitrary characters.  Question mark matches any one character.
  703. `[a-g]' matches any one letter in a, b, ..., g.  `[zen]' matches one of z,
  704. e, or n.  Parentheses serve to group expressions.  An exp `g*' matches file
  705. names that begin with a `g'; `*.c' matches those ending in `.c'
  706.  
  707. The 3 dots, as in `c:\tex\...', stand for all the names
  708. of the files in the subtree at `c:\tex'.  If `c:\tex' has
  709. subdirectories, and so on, all their names and files they contain are
  710. included.  Thus, `echo e:\...\*.c' will show all the `.c'
  711. files in all the directories on drive e.  Remember that `...'
  712. expansion causes many directories to be visited.  This is not only
  713. time consuming, but also seems to trigger the Atari TOS's 40 folder
  714. bug after a few such operations.  (In my tests, I never lost a file as
  715. a result.  Nor can I tell precisely when and in what form this shows
  716. up.  Most frequent indication was that `cd' to an existing drive
  717. would fail.)
  718.  
  719.  
  720. File: gulam.info  Node: flags, Prev: expressions, Up: top, Next: history-substitutions
  721.  
  722. Flags
  723. -----
  724.  
  725. Most commands (built-in or external) take flags to alter the behavior of
  726. the command in a minor way.  The convention made popular by Unix shells is
  727. adopted here for *Gulam*'s built-ins: a flag is of the form
  728. `-C', or `+C', where C stands for one
  729. character.  The option `-i', which interrogates you for each of the
  730. operand of the command before executing it, is provided on most commands.
  731.  
  732.  
  733. File: gulam.info  Node: foreach, Prev: file-names, Up: Glossary, Next: format
  734.  
  735. foreach
  736. -------
  737.  
  738. The `foreach' command is used in shell scripts (but not at the
  739. terminal) to specify repetition of a sequence of commands while the value
  740. of a certain shell variable ranges through a specified list.  The
  741. `foreach' command ends with an `endfor' on a separate line all by
  742. itself.
  743.  
  744.      foreach i { a b c *.o [a-k]*[ch] } 
  745.              echo $i 
  746.      endfor 
  747.  
  748.  
  749. File: gulam.info  Node: format, Prev: foreach, Up: Glossary, Next: gem
  750.  
  751. format
  752. ------
  753.  
  754. This command formats diskettes, in the standard form (360K, or 720K) in
  755. either the `A' or `B' floppy drive.  It does not touch
  756. hard-/ram-disks, no matter what arguments (illegal or not) you give it.
  757. Its valid arguments are either `a', `b', or both.  The optional
  758. flag `-2' implies double-sided formatting; otherwise the diskette is
  759. formatted single-sided.
  760.  
  761.      format        # does nothing 
  762.      format b      # format the floppy in dr B, single-sided 
  763.      format -1 b   # same as format b 
  764.      format -2 a   # format the floppy in dr A, double-sided 
  765.  
  766. If you issue the wrong command (e.g., `format -2 a' on a single-sided
  767. drive), you will hear a lot of grinding noises; a `control-C' will kill
  768. this, but not right away.
  769.  
  770.  
  771. File: gulam.info  Node: gem, Prev: format, Up: Glossary, Next: grep
  772.  
  773. gem
  774. ---
  775.  
  776. The word `gem' is a prefix, like `time' is, to commands.  This
  777. enables proper running via *Gulam* of most programs that use the
  778. desktop metaphor.  It clears screen, turns cursor off, enables mouse and
  779. then executes the command, and after the command is finished it again
  780. clears screen, turns cursor on, disables mouse.
  781.  
  782. The `time' and `gem' prefixes mix in either order, and the
  783. command name will be searched for in the usual way.
  784.  
  785. We do not know, for sure, if all desktop/window/mouse oriented programs can
  786. be run properly with this command prefix.  So experiment, and be ready to
  787. hit the reset button before using the prefix.
  788.  
  789. `dvi' is an example of a command that needs to be run with `gem'
  790. prefix.  And you may be tempted to do the following.
  791.  
  792.      alias dvi 'gem dvi'              # recurses infinitely 
  793.      alias dzz dvi                    # dzz or whatever 
  794.      alias dvi 'gem dzz'              # will work 
  795.      alias dvi 'gem c:\bin\dvi.prg'   # also will work 
  796.  
  797.  
  798. File: gulam.info  Node: grep, Prev: gem, Up: Glossary, Next: gulam.g
  799.  
  800. grep/egrep/fgrep
  801. ----------------
  802.      grep/egrep/fgrep RE-PATTERN FILENAMES
  803.  
  804. The `grep' command searches through a list of argument files for a
  805. specified string.  Thus
  806.  
  807.      grep lex[aw] e:\gulam\*.c 
  808.  
  809. will print each line in the files that contains a substring matching
  810. `lex[aw]'. `grep' stands for "globally find regular expression
  811. matches and print". `grep' and `egrep' are one and the same.
  812. The first argument to `egrep' is a regular expression, and the rest
  813. are expected to be file names. `fgrep''s first argument is the as-is
  814. string to be searched for in the files.  Because of the preprocessing done
  815. by *Gulam*, the as-is string for `fgrep' or the regular exp for
  816. `egrep' is generally enclosed in single-quotes.
  817.  
  818.  
  819. File: gulam.info  Node: gulam.g, Prev: grep, Up: Glossary, Next: help
  820.  
  821. gulam.g
  822. -------
  823.  
  824. Files with the `.g' extension are expected to contain *Gulam*
  825. commands; `gulam.g' is the name of the startup file.  *Gulam*
  826. attempts to find this file in the current directory, and if found executes
  827. its contents.  Here is an example file:
  828.  
  829.      # bgn of my gulam.g
  830.      
  831.      set prompt      '$ncmd $cwd gu > $u'
  832.      set histfile    e:\history.g
  833.      set baud_rate   9600
  834.      set sz_rs232_buffer     4096
  835.      # set palette; note the trailing '-'
  836.      set rgb '005-707-070-075-'
  837.      # the following sets tabs on Epson MX-80
  838.      set pr_bof '^Q033^QD^Q010^Q020^Q030^Q040^Q050^Q033^QC^Q102'
  839.      set pr_eof '^Q214'
  840.      set pr_eop '^Q214^Qn'
  841.      set pr_eol '^Qr^Qn'
  842.      
  843.      #setenv PATH c:\bin,d:\bin,f: # no trailing back slashes
  844.      #rehash
  845.      set path c:\bin,d:\bin,f:     # equiv to above 2 lines
  846.      setenv TEMP f:\
  847.      alias h  history
  848.      alias ll 'ls -lF'
  849.      alias p  more
  850.      alias rm 'rm -i' # asks before deleting
  851.      alias ug 'ue e:\gulam\$1.c'
  852.      alias cg 'f:\cc.ttp -c -V -Ie:\gulam -DMWC e:\gulam\$1.c'
  853.      alias cpall 'cp e:\ue\*.o e:\gulam*.o f:\ '
  854.      alias bk 'cp e:\gulam\*.[chs] a:\ '
  855.      # end of my gulam.g
  856.  
  857.  
  858. Gulam Variables and Environment
  859. -------------------------------
  860.  
  861. The following shell variables cause/control useful effects.  The format of
  862. the explanation is `variable_name: default-value meaning'.
  863.  
  864. `batch_max_nesting: 20'     
  865.      if you need to nest batch file execution at levels deeper than this,
  866.      change this variable.
  867.      
  868. `batch_echo: 0'     
  869.      if  1  echoes each command of the batch file as it is executed.  
  870.      
  871. `baud_rate: none'     
  872.      for  use  in  the  terminal  emulator, rx/sx file transfers.  
  873.      
  874. `cwd:'     
  875. `CWD: full  pathname  of  current directory'     
  876.      gets re-set every time a cd, pushd or popd is executed.  
  877.      
  878. `delay: unset'     
  879.      set it to control the duration that the cursor sits
  880.      on a matching paren, bracket, or brace.  A value of 2000 produces about
  881.      a 2-sec delay.
  882.      
  883. `dir_cache: 0'     
  884.      if non-0, turns on the dir list cache.  This substantially speeds up the
  885.      Tenex file name completion.
  886.      
  887. `ginprompt: $<'     
  888.      the  prompt  shown  when  asking you for input in dollar-substituting a $<.
  889.      
  890. `gulam_help_file: none'     
  891.      set this var to the full pathname of the `gulam.hlp' file, which
  892.      contains descriptive info about keys, functions, bindings and
  893.      commands.  Unless this var is set properly, the wall chart that
  894.      `ue' generates is of not much use.
  895.      
  896. `histfile: none'     
  897.      reads and saves history in file named $histfile .
  898.      
  899. `history: 20'     
  900.      This variable controls the number of previous commands displayed
  901.      by the command `history'.
  902.      
  903. `home'     
  904. `HOME: full pathname of home directory'     
  905.      home  is  the directory you were in before invoking *Gulam*.  
  906.      
  907. `mscursor: unset'     
  908.      set it to a string of 4 digits (e.g., "0508").  This
  909.      controls the scaling of mouse movements being turned into cursor keys.  If
  910.      it is set to "0000", mouse movements do not get translated to cursor keys.
  911.      
  912.      
  913. `ncmd: number  of  the  current  command'     
  914.      gets  set  after each executing each command.  
  915.      
  916. `nrows: unset'     
  917.      This variable controls the number of lines per screen.  At present, only
  918.      valid values are 25 or 50.  Changing `nrows' to 50 will cause the
  919.      re-initialization of the screen using the small system font.
  920.      
  921. `path: unset'     
  922.      when set, it will cause the environment variable PATH to be
  923.      automatically also set to the same string ($path), and cause
  924.      rehashing.
  925.      
  926. `parent_expand: unset'     
  927.      when set, the Tenex name completion will provide the full path name rather
  928.      than just the leaf name.
  929.  
  930. The following pr_XXX vars are relevant with `print', and `lpr'
  931. commands.  When set, these strings are sent to the printer :
  932.  
  933. `pr_bof: unset'     
  934.      send before printing each new file.
  935. `pr_eol: rn'     
  936.      send after each line.
  937. `pr_eop:214'     
  938.      send after each page (214 == ASCII ^L + 0200). 
  939. `pr_eof: 214'     
  940.      send after the end of file.  
  941.  
  942. Thus, to have a left margin of eight-spaces, just define `pr_eol' as
  943. `rnt'.  To turn condensed mode etc., just set
  944. `pr_bof' to the appropriate string after looking it up in the
  945. printer's manual.  See the section on strings for an explanation of
  946. .
  947.  
  948. `prompt: >>'     
  949.      see gulam.g for an example.
  950. `prompt_tail: unset;'     
  951.      when set,   $prompt_tail  is  appended  to  the  displayed  prompt
  952.      string.   This is a kludge to mollify those of you who insist
  953.      on having a trailing blank in their prompt! 
  954. `rgb'     
  955. `RGB: `000-700-007-070-''     
  956.      sets  the  palette:  3 octal digits (followed by a  dummy  '-')  per
  957.      color;  2  in  hi-rez,  4  in med-rez, 16 in low-rez.
  958. `rx_remote_cmd: unset'     
  959.      command  to  send  to remote to receive file
  960.      with  Xmodem.   For  our  Unix, this string is `xm st'.  The rx
  961.      command  appends  a space followed by the file name and sends
  962.      the resulting string to the remote as if you typed it.  
  963. `sx_remote_cmd: unset'     
  964.      command to send to remote to send file with Xmodem.  Similar to the above.  
  965. `semicolon_max: 20'     
  966.      Number  of `;' per line; to stop infinite recursions in alias expanded
  967.      commands.
  968. `status'     
  969.      status  of  the  most  recent external command; set after each external
  970.      command.
  971. `sz_rs232_buffer: unset'     
  972.      The  built-in  terminal  emulator,  when invoked,  will  reallocate  a
  973.      buffer  of  this size (if this value  is  >  256) for the associated IOREC.
  974.      If unset, or if set  but  to  a  value  lower  than  4096, you may experience
  975.      XON/XOFF occuring at 9600.  I recommend 4096.
  976. `time: unset'     
  977.      If set to non-0, times every command.  
  978. `verbosity: unset'     
  979.      This controls the amount of feed back you get from *Gulam*.  When
  980.      unset, or set to <= 0, *Gulam* will be extremely quiet, and report
  981.      only on errors.  If you wish commands like `cp' to report the
  982.      goings-on, set verbosity to 2.
  983.  
  984.  
  985. HELP
  986. ----
  987.  
  988. The all-upper case name `HELP' in this manual stands for the key marked
  989. `HELP' on the Atari ST.  Pressing this key, outside the `ue', will
  990. show all the *Gulam* built-in commands, and a brief version of the
  991. hash table.  Within `ue', it can show the binding of an individual
  992. key, or produce a wall-chart of all bindings.
  993.  
  994. The `shift-HELP' key resets the special key table mapping that Gulam/uE
  995. use; after pressing `shift-HELP' the function keys, and arrow keys
  996. become equivalent to `^@', and the keypad will work as a typcial
  997. numerical keypad.  To get back to the Gulam/uE key table, press
  998. `^L', which not only refreshes the display but also sets the key
  999. table.
  1000.  
  1001.  
  1002. File: gulam.info  Node: help, Prev: grep, Up: Glossary, Next: history
  1003.  
  1004. help
  1005. ----
  1006.  
  1007. Typing the letters `help' while outside `ue', or in buffer
  1008. *gulam* is equivalent to pressing `HELP'.
  1009.  
  1010.  
  1011. File: gulam.info  Node: history, Prev: help, Up: Glossary, Next: if
  1012.  
  1013. history
  1014. -------
  1015.      history [-h]
  1016.  
  1017. The `history' command lists the last N commands.  Each command is
  1018. preceded by its number; to suppress these numbers, supply the `-h'
  1019. flag.  The value N is obtained by `$history'.  To change this N to,
  1020. say, 30, do `set history 30'.
  1021.  
  1022.  
  1023. File: gulam.info  Node: history-substitutions, Prev: flags, Up: top, Next: io-redirection
  1024.  
  1025. History Substitutions
  1026. ---------------------
  1027.  
  1028. Occurrences of the form `!!', `!number', `!string' refer to
  1029. the text of previously issued commands.  The text of these older commands
  1030. itself does not contain `!' unless it is part of a string argument.
  1031. Each `!!' is replaced by the text of the immediately preceding
  1032. command.  *Gulam* consecutively numbers the commands that you have
  1033. issued.  (The current count can be seen in the shell variable named
  1034. NCMD.) Each `!n' is replaced by the
  1035. n-th  old  command.   Each  `!str' is a replaced by the most recent
  1036. old command that begins with str.  
  1037.  
  1038. The name completion feature works with history substitutions also.
  1039. Pressing `INSERT' or `ESC-ESC' will bring the history-matched
  1040. command and replace the current line in the buffer, which you can further
  1041. edit.
  1042.  
  1043.  
  1044. $home also $HOME
  1045. ----------------
  1046.  
  1047. The shell variable "home" is initially set to the full pathname of the
  1048. directory from which *Gulam* was invoked.  However, it can be set
  1049. again with set command to whatever.  The wiggle `~' in file
  1050. names expands to "$HOME".  
  1051.  
  1052.  
  1053. File: gulam.info  Node: if, Prev: history, Up: Glossary, Next: lpr
  1054.  
  1055. if
  1056. --
  1057.  
  1058. The "if" stmt is similar to those in many programming languages.  The
  1059. Boolean expression of shell if stmts typically involves tests on file names
  1060. and types.  (See Expressions.) There is no `then'.  Any remaining
  1061. lexemes after the Boolean exp are ignored.
  1062.  
  1063.      if {-d e:\gulam\lex} + 2 == 3 
  1064.              echo e:\gulam\lex is a dir 
  1065.      ef -e e:\gulam\lex      # read ef as `else if' 
  1066.              echo e:\gulam\lex does exist 
  1067.      ef 
  1068.              echo e:\gulam\lex does NOT exist 
  1069.      endif 
  1070.  
  1071.  
  1072. File: gulam.info  Node: io-redirection, Prev: history-substitutions, Up: top, Next: metacharacter-expansion
  1073.  
  1074. IO Redirection
  1075. --------------
  1076.  
  1077. Prefixing a file name F with `>' causes all standard output
  1078. produced by that command to get deposited into file F.  Similarly,
  1079. `<g' will cause standard input to be taken from the file G
  1080. rather than the key board.  If you prefer, you may include white chars
  1081. between the `<' (or `>' ) and the filename.  If you have more
  1082. than one `<', or `>' in a command all but the last are ignored.
  1083.  
  1084. Note that because of TOS and compiler peculiarities, not all external
  1085. commands will behave as above.
  1086.  
  1087.      ls -l > lsout # get the ls -l output into file lsout
  1088.      ls -l >> f1   # append the ls -l output to f1
  1089.      ecmd '>blah'  # invoke ecmd and give it the arg >blah as is to it.  
  1090.  
  1091.  
  1092. File: gulam.info  Node: kb, Prev: if, Up: Glossary, Next: lpr
  1093.  
  1094. kb
  1095. --
  1096.  
  1097. This command redefines microEmacs keybindings.  To bind key with code 144
  1098. to function with hex-number 1d while you are in the *regular* buffer,
  1099. do
  1100.  
  1101.      kb -r 144 1d      
  1102.  
  1103. Use -g for redefining the bindings of *gulam* buffer; -m for mini
  1104. buffer.  You can find the key codes and hex-numbers of functions in the
  1105. wall-chart (shown below), which can be produced by pressing the `HELP'
  1106. key, a `B', and then a `r' (or `g', or `m').  The key
  1107. names, and function names will not appear unless a `set
  1108. gulam_help_file <filename>' was done earlier.
  1109.  
  1110.      key-code in hex
  1111.      |    function code in hex
  1112.      |    |    key name (kb ignores this)
  1113.      |    |    |         function name (kb ignores this)
  1114.      ---------------------------------------------------
  1115.      081  5c   F1         kill-backward-word
  1116.      082  5d   F2         kill-word
  1117.      083  20   F3         kill-line
  1118.      084  35   F4         copy-region-as-kill
  1119.      085  51   F5         kill-buffer
  1120.      086  50   F6         list-buffers
  1121.      087  4e   F7         switch-to-buffer
  1122.      088  3f   F8         write-file
  1123.      089  3d   F9         find-file
  1124.      08a  3e   F10        save-buffer
  1125.      08b  14   HELP       help
  1126.      08c  0d   UNDO       quick-exit
  1127.      08d  62   INSERT     scroll-down
  1128.      08e  61   HOME       scroll-up
  1129.      0bb  23   UPARRO     previous-line
  1130.      0bc  0f   DNARRO     gulam-forward-line
  1131.      0bd  1a   LTARRO     backward-char
  1132.      0be  1b   RTARRO     forward-char
  1133.      140  30   C-@       set-mark-command
  1134.      141  1e   C-A        beginning-of-line
  1135.      142  1a   C-B        backward-char
  1136.      143  06   C-C        switch-to-gulam-buffer
  1137.      144  1d   C-D        delete-char
  1138.      145  1f   C-E        goto-end-of-line
  1139.      146  1b   C-F        forward-char
  1140.      147  13   C-G        keyboard-quit
  1141.      148  1c   C-H        backward-delete-char
  1142.      149  11   TAB        goto-next-tab
  1143.      14a  25   LFD        newline-and-indent
  1144.      14b  20   C-K        kill-line
  1145.      14c  19   C-L        redraw-display
  1146.      14d  10   RET        gulam-do-newline
  1147.      14e  0f   C-N        gulam-forward-line
  1148.      14f  22   C-O        open-line
  1149.      150  23   C-P        previous-line
  1150.      151  33   C-Q        quoted-insert
  1151.      152  2b   C-R        search-backward
  1152.      153  2c   C-S        search-forward
  1153.      154  34   C-T        transpose-chars
  1154.      156  61   C-V        scroll-up
  1155.      157  36   C-W        kill-region
  1156.      159  3b   C-Y        yank
  1157.      15a  0e   C-Z        temporary-exit
  1158.      15f  14   C-_        help
  1159.      029  6b   )          blink-matching-paren-hack
  1160.      07d  6b   }         blink-matching-paren-hack
  1161.      05d  6b   ]          blink-matching-paren-hack
  1162.      0c0  0c   KLP        move-window-dn
  1163.      0c1  0b   KRP        move-window-up
  1164.      0c7  4a   KSLASH     split-window-vertically
  1165.      0c2  49   KSTAR      delete-other-windows
  1166.      0c5  45   KMINUS     previous-window
  1167.      0c3  44   KPLUS      next-window
  1168.      0c4  17   KENTER     call-last-kbd-macro
  1169.      0c6  26   KDOT       goto-line
  1170.      0b0  0a   K0         terminal-emulator
  1171.      0b7  55   K7         beginning-of-buffer
  1172.      0b8  32   K8         recenter
  1173.      0b9  54   K9         end-of-buffer
  1174.      0b4  5a   K4         backward-word
  1175.      0b5  23   K5         previous-line
  1176.      0b6  5e   K6         forward-word
  1177.      0b1  1e   K1         beginning-of-line
  1178.      0b2  0f   K2         gulam-forward-line
  1179.      0b3  1f   K3         goto-end-of-line
  1180.      541  09   C-X C-A    show-key-board-macro
  1181.      542  50   C-X C-B    list-buffers
  1182.      543  12   C-X C-C    save-buffers-kill-emacs
  1183.      546  3d   C-X C-F    find-file
  1184.      549  4d   C-X TAB    insert-buffer
  1185.      54f  41   C-X C-O    delete-blank-lines
  1186.      54e  0c   C-X C-N    move-window-dn
  1187.      550  0b   C-X C-P    move-window-up
  1188.      552  08   C-X C-R    read-file
  1189.      553  3e   C-X C-S    save-buffer
  1190.      556  3d   C-X C-V    find-file
  1191.      557  3f   C-X C-W    write-file
  1192.      558  42   C-X C-X    exchange-point-and-mark
  1193.      55a  46   C-X C-Z    shrink-window
  1194.      421  27   C-X !      execute-one-Gulam-command
  1195.      421  07   C-X !      execute-buffer
  1196.      43d  43   C-X =      what-cursor-position
  1197.      428  15   C-X (      start-kbd-macro
  1198.      429  16   C-X )      end-kbd-macro
  1199.      431  49   C-X 1      delete-other-windows
  1200.      432  4a   C-X 2      split-window-vertically
  1201.      442  4e   C-X B      switch-to-buffer
  1202.      445  17   C-X E      call-last-kbd-macro
  1203.      446  18   C-X F      no-op
  1204.      449  3c   C-X I      file-insert
  1205.      44b  51   C-X K      kill-buffer
  1206.      44e  44   C-X N      next-window
  1207.      44f  44   C-X O      next-window
  1208.      450  45   C-X P      previous-window
  1209.      453  52   C-X S      save-some-buffers
  1210.      45a  47   C-X Z      enlarge-window
  1211.      348  5c   ESC C-H    kill-backward-word
  1212.      221  07   ESC !      execute-buffer
  1213.      22e  30   ESC .      set-mark-command
  1214.      23e  54   ESC >      end-of-buffer
  1215.      23c  55   ESC <      beginning-of-buffer
  1216.      25b  56   ESC [      beginning-of-paragraph
  1217.      25d  57   ESC ]      end-of-paragraph
  1218.      225  2f   ESC %      query-replace
  1219.      220  59   ESC SPC    just-one-space
  1220.      242  5a   ESC B      backward-word
  1221.      243  5b   ESC C      capitalize-word
  1222.      244  5d   ESC D      kill-word
  1223.      246  5e   ESC F      forward-word
  1224.      247  06   ESC G      switch-to-gulam-buffer
  1225.      24c  5f   ESC L      downcase-word
  1226.      251  29   ESC Q      fill-paragraph
  1227.      252  2b   ESC R      search-backward
  1228.      253  2c   ESC S      search-forward
  1229.      255  60   ESC U      upcase-word
  1230.      256  62   ESC V      scroll-down
  1231.      257  35   ESC W      copy-region-as-kill
  1232.      27f  5c   ESC DEL    kill-backward-word
  1233.      35b  05   ESC ESC    expand-name-gulam-style
  1234.      344  63   ESC C-D    expand-names-and-show-them
  1235.      346  04   ESC C-F    file-name
  1236.      07f  1c   DEL        backward-delete-char
  1237.      0ab  37   SHIFT-HELP keys-reset
  1238.      000  00   NUL        no-op
  1239.      000  00   NUL        no-op
  1240.      000  00   NUL        no-op
  1241.      000  00   NUL        no-op
  1242.      000  00   NUL        no-op
  1243.      000  00   NUL        no-op
  1244.      000  00   NUL        no-op
  1245.      000  00   NUL        no-op
  1246.      000  00   NUL        no-op
  1247.      000  00   NUL        no-op
  1248.  
  1249.  
  1250. File: gulam.info  Node: lpr, Prev: if, Up: Glossary, Next: ls
  1251.  
  1252. lpr
  1253. ---
  1254.      lpr FILENAMES
  1255.  
  1256. The command `lpr' prints its files as-is, with no processing at the
  1257. end of lines.
  1258.  
  1259.  
  1260. File: gulam.info  Node: ls, Prev: lpr, Up: Glossary, Next: mem
  1261.  
  1262. ls
  1263. --
  1264.      ls [-ltrRLF] FILENAMES 
  1265.  
  1266. The `ls' (list files) command, with no arguments, prints the sorted
  1267. list of names of the files in the current directory.  It has a number of
  1268. useful flag arguments, and can also be given the names of directories as
  1269. arguments, in which case it lists the names of the files in these
  1270. directories.
  1271.  
  1272. If no flags are given, `ls' prints only the filenames.  The `-L'
  1273. causes a full-length line for each file giving its attributes, size,
  1274. creation date, and name.  The `-l' (small el) is the same as `-L'
  1275. except that the output is sorted by name.  The `-R' will cause the
  1276. subtrees of directories in the argument list of files to be traversed.  The
  1277. `-F' will append to each listed filename one char that indicates the
  1278. type of that file: `*' if it is executable (i.e., has an extension of
  1279. `.prg, .tos, .ttp', or `.g'), a `\' if its is a directory, a
  1280. ' ' otherwise.  The `-t' causes a sort by time of modification of the
  1281. files.  The `-r' reverses the chosen order of sorting.
  1282.  
  1283. `ls' always (even if DIR_CACHE is 1)
  1284. updates the directory cache for the relevant directories.
  1285.  
  1286.  
  1287. File: gulam.info  Node: mem, Prev: ls, Up: Glossary, Next: mkdir
  1288.  
  1289. mem
  1290. ---
  1291.  
  1292. `mem' shows the list of free chunks of memory available.  It does
  1293. this by following lists starting at an (undocumented) TOS location
  1294. (`0x7e8e' for ROMS dated 04221987, `56ec' for older ROMS),
  1295. Because of the way *Gulam* uses dynamically allocated memory,
  1296. the size of the largest free chunk fluctuates both up and down as
  1297. chunks get coalesced and split.
  1298.  
  1299.     `mem -a' shows not only the free list, but also GEMDOS list of
  1300. Malloc-ated chunks.
  1301.  
  1302.  
  1303. File: gulam.info  Node: metacharacter-expansion, Prev: io-redirection, Up: top, Next: path
  1304.  
  1305. Metacharacter Expansion
  1306. -----------------------
  1307.  
  1308. The characters `!$()[]><~*?', called "meta characters", have
  1309. special meaning to *Gulam*.  If it is necessary to embed these
  1310. characters in arguments to commands but without such special meaning, you
  1311. must enclose the argument in single-quotes.
  1312.  
  1313. Arguments (to built-in or external commands) that contain meta chars are
  1314. expanded as follows.  The `!' is expanded first; see History
  1315. Substitution.  After this, the meta chars `$()[]~*?' are expanded from
  1316. left-to-right.  See Dollar Substitution.  The wiggle `~' stands for
  1317. `$HOME'.  The remaining meta chars `()[]*?' are part of the
  1318. "fnmre" -- regular expressions for file names.  Fnmre are slightly
  1319. different from egrep's Regular Expressions.  An fnmre differs from re in
  1320. (1) `.' stands for itself; (2) `*' is matches zero or more arbitrary
  1321. characters.  Occurrences of an fnmre, outside of strings, are replaced by
  1322. the sorted blank-separated list of file names matching the fnmre; see also
  1323. File Names.
  1324.  
  1325.  
  1326. File: gulam.info  Node: mkdir, Prev: mem, Up: Glossary, Next: mv
  1327.  
  1328. mkdir
  1329. -----
  1330.      mkdir NAMES
  1331.  
  1332. The "mkdir" command creates new directories with the arguments as their
  1333. names.
  1334.  
  1335.  
  1336. more
  1337. ----
  1338.  
  1339. This is a built-in alias, if you will, to `ue -r'.
  1340.  
  1341.  
  1342. File: gulam.info  Node: mv, Prev: mkdir, Up: Glossary, Next: mson
  1343.  
  1344. mv
  1345. --
  1346.      mv FILENAMES TARGET-DIR
  1347.      mv FILENAME1 FILENAME2
  1348.  
  1349. Moves files.  In the first form, any number of files may be moveed into the
  1350. destination directory; files in the target dir will have their original
  1351. names.  In the second form, only one file is moved, and the new one will be
  1352. named filename2.  On the Atari ST, moving files is accomplished by copying
  1353. and then deleting the source file unless it is the second form and both are
  1354. in the same directory.
  1355.  
  1356.  
  1357. File: gulam.info  Node: mson, Prev: mv, Up: Glossary, Next: peekw
  1358.  
  1359. mson/msoff
  1360. ----------
  1361.  
  1362. These commands enable/disable the mouse.  To make the mouse disappear
  1363. give the command  `msoff' and to make it re-appear again, give the
  1364. command `mson'.  Most GEM-based `.prg' programs use mouse, but do
  1365. not set it up themselves.  Some of these will hang if invoked from
  1366. *Gulam*, which is no big deal; do `mson' and then try.
  1367.  
  1368. *Gulam* makes use of the mouse in two effective ways.
  1369. (1) When in Gulam command mode, moving the mouse around
  1370. allows you to select among previous commands that you
  1371. have in your history.  You can edit these in the usual
  1372. way with `ue' like commands.
  1373. (2) When editing a buffer with `ue', moving the mouse around
  1374. will move the cursor around the screen.
  1375.  
  1376. To modify the effect of the mouse, set the variable  `mscursor'
  1377. to a four digit number.  The command
  1378. `set mscursor 0508'
  1379. is equivalent to the default mouse action.  The command
  1380. `set mscursor 1016'
  1381. you will require twice as much movement of the mouse to get the
  1382. same effect on the screen, and
  1383. `set mscursor 0000'
  1384. will turn it off altogether.
  1385.  
  1386.  
  1387.  
  1388. File: gulam.info  Node: path, Prev: metacharacter-expansion, Up: top, Next: query-search-replace
  1389.  
  1390. $path also $PATH
  1391. ----------------
  1392.  
  1393. A comma-separated list (with no white chars) of directiries should be
  1394. the value of the environment variable `PATH'.  `PATH' can be
  1395. set independently by using `setenv', however, it gets
  1396. automatically reset to the value of `path' every time you do a
  1397. `set path whatever'.  This value is used by `rehash'
  1398. command.  `rehash' scans the files in each directory looking for
  1399. executable files (by def, files with extensions of `.prg',
  1400. `.tos', `.ttp', or `.g').  The leaf names and full
  1401. pathnames are entered into a hash table.  Typing the `help'
  1402. command (not the `HELP' key) will list the hash table in brief;
  1403. `which' command lists it in full.  *Gulam* does NOT auto
  1404. rehash whenever `PATH' is changed, but does rehash whenever
  1405. `path' is changed.
  1406.  
  1407.      setenv PATH c:,c:\bin,d:\mwc\bin 
  1408.  
  1409.  
  1410. File: gulam.info  Node: peekw, Prev: mson, Up: Glossary, Next: popd
  1411.  
  1412. peekw/pokew
  1413. -----------
  1414.  
  1415. `peekw' and `pokew' are similar to their namesakes in BASIC.  We
  1416. use privileged mode to alter/access any arbitrary location.  These commands
  1417. expect their arguments to be hex numbers, so do not begin the numbers with
  1418. `0x', or `$'.  The pokew command should be used with care.
  1419.  
  1420.      peekw 420      # shows you what is at word at 0x420 
  1421.      pokew 420 123E # sets word at 0x420 to 0x123E 
  1422.  
  1423. The primary use for these is to examine/alter the TOS variables.  Refer to
  1424. BIOS Hitch Hikers Guide, ST Internals, or some other documentation for a
  1425. full list of these locations.  Here are a few that I often found useful:
  1426.  
  1427. `420 memvalid' Normally contains 0x7520.  If you then press reset the
  1428. ST will do a `warm boot' (which leaves most reset survivable RAM disks to
  1429. be still alive).  If you want to cause a cold boot, `pokew' this
  1430. location to a zero.  (The other way is to power cycle.)
  1431.  
  1432. `42E' and `0x430 phystop' This pair of integers (a long) gives
  1433. the address of top of RAM.
  1434.  
  1435. `440 seekrate' contains a code for the seek rate of floppies: 0 means
  1436. 6 msec, 1 means 12 msec, 2 means 2 msec, and 3 means 3 msec.
  1437.  
  1438. `444 fverify' If `pokew' to zero, disk writes are not verified; any
  1439. other value will.
  1440.  
  1441.  
  1442. File: gulam.info  Node: popd, Prev: peekw, Up: Glossary, Next: print
  1443.  
  1444. popd
  1445. ----
  1446.  
  1447. The `popd' command changes the shell's working directory to the one on
  1448. top of the directory stack.  Also, sets `cwd', and `CWD'.
  1449.  
  1450.  
  1451. File: gulam.info  Node: print, Prev: popd, Up: Glossary, Next: printenv
  1452.  
  1453. print
  1454. -----
  1455.      print FILENAMES
  1456.  
  1457. The `print' command is used to prepare listings of the contents
  1458. of files with headers giving the name of the file and the date and
  1459. time at which the file was last modified.  Use the `date' command
  1460. to set the time and date of the system properly.
  1461.  
  1462.  
  1463. File: gulam.info  Node: printenv, Prev: print, Up: Glossary, Next: pushd
  1464.  
  1465. printenv
  1466. --------
  1467.  
  1468. The `printenv' command is equivalent to `setenv' with no
  1469. arguments.
  1470.  
  1471.  
  1472. $prompt
  1473. -------
  1474.  
  1475. *Gulam* prompts for input with the contents of this variable.  Set
  1476. it with the `set' command.
  1477.  
  1478.      set prompt      '$ncmd $cwd gu > $u' 
  1479.  
  1480.  
  1481. File: gulam.info  Node: pushd, Prev: printenv, Up: Glossary, Next: pwd
  1482.  
  1483. pushd
  1484. -----
  1485.      pushd [DIR]
  1486.  
  1487. The `pushd' (push directory) command pushes the name of the current
  1488. directory on to the internal stack, and `cd''s to the directory given
  1489. by the argument.  You can later do a `popd' to return to the present
  1490. current directory.  The command `pushd', without arguments, exchanges
  1491. the working directory with the one on top of the stack.
  1492.  
  1493.  
  1494. File: gulam.info  Node: pwd, Prev: pushd, Up: Glossary, Next: rehash
  1495.  
  1496. pwd
  1497. ---
  1498.  
  1499. This built-in command prints the full pathname of the current working
  1500. directory.  It is equivalent to
  1501.  
  1502.          echo $cwd
  1503.  
  1504.  
  1505. File: gulam.info  Node: query-search-replace, Prev: path, Up: top, Next: regular-expressions
  1506.  
  1507. Query Search/Replace
  1508. --------------------
  1509.  
  1510. The built-in `ue' uses regular expression search and replace; see
  1511. Regular Expressions.  This function is normally bound to `ESC-%'.  When
  1512. you invoke it, it will ask you to type the search pattern, and then the
  1513. replace pattern.  It then enters the search/replace mode: finds the next
  1514. (to the right, and below) occurrence of the search pattern, and awaits your
  1515. response.  You type
  1516.   1. a `SPACE' to replace the occurrence of the
  1517.      search pattern
  1518.   2. a `DELETE' to skip to the next occurrence
  1519.   3. a dot (`.') to replace this one and then terminate search/replace
  1520.   4. `ESC' to end the search/replace right now, and
  1521.   5. an exclamation (`!') to replace this and all further occurrences without
  1522.      bothering to ask you.
  1523.  
  1524. If you forget all this, type an arbitrary key and you will get the brief
  1525. reminder:
  1526.  
  1527.      <SP>rplce, [.]rep-end, <DEL>dont, [!]repl rest, <ESC>quit
  1528.  
  1529. The only char that has a special meaning in the replace string is `&'; all
  1530. other meta-chars stand literally for themselves.  An `&' stands for the
  1531. substring that matched the whole regular expression.  A `\n', where n is a
  1532. digit in 1 to 9, stands for the substring that matched the n-th
  1533. parenthesized expression within the regular expression, with parenthesized
  1534. expressions
  1535. numbered in left-to-right order of their opening parentheses.  
  1536.  
  1537. Be aware of a peculiarity of the search/replace: The `^' and `$'
  1538. of the regular expression match the positions just right of the dot, and
  1539. just left of the dot.  Thus, if you give a search string of '`^'', and
  1540. replace string '`a'', and then issue a '`!'', you will be
  1541. inserting '`a'' forever (until `ue' runs out of memory).
  1542.  
  1543.  
  1544. File: gulam.info  Node: regular-expressions, Prev: query-search-replace, Up: top, Next: strings
  1545.  
  1546. Regular Expressions
  1547. -------------------
  1548.  
  1549. [This  section  is a mildly edited man page of regexp(3) by Henry
  1550. Spencer.] 
  1551.  
  1552. A  regular  expression  is  zero  or  more branches, separated by
  1553. `|'.  It matches anything that matches one of the branches.  
  1554.  
  1555. A  branch  is  zero  or  more pieces, concatenated.  It matches a
  1556. match for the first, followed by a match for the second, etc.  
  1557.  
  1558. A  piece  is  an  atom possibly followed by `*', `+', or `?'.  An
  1559. atom  followed  by `*' matches a sequence of 0 or more matches of
  1560. the  atom.   An  atom  followed by `+' matches a sequence of 1 or
  1561. more  matches  of  the  atom.   An atom followed by `?' matches a
  1562. match of the atom, or the null string.  
  1563.  
  1564. An  atom is a regular expression in parentheses (matching a match
  1565. for  the  regular expression), a range (see below), `.' (matching
  1566. any  single  character),  `^'  (matching  the  null string at the
  1567. beginning  of the input string), `$' (matching the null string at
  1568. the  end  of  the  input  string),  a  `e'  followed  by a single
  1569. character  (matching  that character), or a single character with
  1570. no other significance (matching that character).  
  1571.  
  1572. A  range  is  a  sequence  of  characters  enclosed  in `[]'.  It
  1573. normally  matches any single character from the sequence.  If the
  1574. sequence  begins  with  `^',  it matches any single character not
  1575. from  the  rest  of  the  sequence.   If  two  characters  in the
  1576. sequence  are  separated  by  `-', this is shorthand for the full
  1577. list  of  ASCII characters between them (e.g. `[0-9]' matches any
  1578. decimal  digit).   To include a literal `]' in the sequence, make
  1579. it  the first character (following a possible `^').  To include a
  1580. literal `-', make it the first or last character.  
  1581.  
  1582. If  a  regular  expression could match two different parts of the
  1583. input  string,  it  will match the one which begins earliest.  If
  1584. both  begin  in  the  same  place but match different lengths, or
  1585. match  the  same  length in different ways, life gets messier, as
  1586. follows.  
  1587.  
  1588. In   general,  the  possibilities  in  a  list  of  branches  are
  1589. considered  in  left-to-right  order,  the possibilities for `*',
  1590. `+',  and `?' are considered longest-first, nested constructs are
  1591. considered  from  the  outermost  in, and concatenated constructs
  1592. are  considered leftmost-first.  The match that will be chosen is
  1593. the  one  that  uses the earliest possibility in the first choice
  1594. that  has to be made.  If there is more than one choice, the next
  1595. will  be  made  in the same manner (earliest possibility) subject
  1596. to the decision on the first choice.  And so forth.  
  1597.  
  1598. For  example,  `(ab|a)b*c'  could match `abc' in one of two ways.
  1599. The  first choice is between `ab' and `a'; since `ab' is earlier,
  1600. and  does  lead  to  a  successful  overall  match, it is chosen.
  1601. Since  the  `b'  is  already  spoken for, the `b*' must match its
  1602. last  possibility  the  empty  string  since  it must respect the
  1603. earlier choice.  
  1604.  
  1605. In  the  particular  case  where no `|'s are present and there is
  1606. only  one  `*',  `+',  or `?', the net effect is that the longest
  1607. possible   match  will  be  chosen.   So  `ab*',  presented  with
  1608. `xabbbby',  will  match  `abbbb'.   Note  that  if `ab*' is tried
  1609. against  `xabyabbbz',  it  will match `ab' just after `x', due to
  1610. the  begins-earliest  rule.  (In effect, the decision on where to
  1611. start  the match is the first choice to be made, hence subsequent
  1612. choices   must   respect   it   even   if   this  leads  them  to
  1613. less-preferred alternatives.) 
  1614.  
  1615. Here are some examples of usage: 
  1616.  
  1617.      ls *[sg]        # print file names ending in s or g
  1618.      egrep '(MWC|MEGAMAX|MANX)' *.c       
  1619.      egrep '^$' *.c  # print line numbers of empty lines
  1620.      egrep 'aa*' *.c
  1621.  
  1622.  
  1623. File: gulam.info  Node: rehash, Prev: pwd, Up: Glossary, Next: ren
  1624.  
  1625. rehash
  1626. ------
  1627.  
  1628. -- see PATH 
  1629.  
  1630.  
  1631. File: gulam.info  Node: ren, Prev: rehash, Up: Glossary, Next: rm
  1632.  
  1633. ren
  1634. ---
  1635.      ren FNM1 FNM2
  1636.  
  1637. Rename file FNM1 as FNM2; they both must be in the same
  1638. directory.
  1639.  
  1640.  
  1641. File: gulam.info  Node: rm, Prev: rx, Up: Glossary, Next: ren
  1642.  
  1643. rm
  1644. --
  1645.      rm FILENAMES
  1646.  
  1647. `rm' removes the named files.  Most of us have the following aliases
  1648. in our `gulam.g' files:
  1649.  
  1650.      alias rm rm -i 
  1651.      alias Rm rm 
  1652.  
  1653. which queries you, for each file, before deleting it.  We use `Rm'
  1654. when we are really sure we want to delete the file(s).  There is
  1655. no  special check to see if you typed `rm *.*' or `rm *'; both of
  1656. these will clear your current directory.  
  1657.  
  1658.  
  1659. File: gulam.info  Node: rx, Prev: rm, Up: Glossary, Next: set
  1660.  
  1661. rx/sx
  1662. -----
  1663.  
  1664. These are built-in commands.  `rx' receives file(s) from the remote
  1665. system; and `sx' sends file(s) to the remote system using Xmodem
  1666. protocol.
  1667.  
  1668.      rx FNM
  1669.  
  1670. command opens/creates file FNM for writing.  If the shell variable
  1671. `rx_remote_cmd' is set, *Gulam* constructs a command for the
  1672. remote system as `$rx_remote_cmd' FNM, and sends this command
  1673. through the rs232 port, and then awaits the packets.  For use with our
  1674. 4xBSD Unix, we set this var to `xm st'.  Unless the `xm' on the
  1675. remote machine is of the quiet type (one that does not respond with, say,
  1676. `Xmodem: Ready to send...'), setting `rx_remote_cmd' actually
  1677. prolongs the first synchronization.  If this var is unset, you should first
  1678. switch to remote (say using te command), and issue the appropriate command
  1679. to the remote, and then switch back to AtariST and give the `rx'
  1680. FNM command.
  1681.  
  1682.      sx FNM
  1683.  
  1684. is essentially similar.  *Gulam* opens FNM for reading, sends
  1685. `$sx_remote_cmd' FNM, if that var is set, and awaits the first
  1686. sync.  For our 4xBSD Unix, we set `sx_remote_cmd' to `xm rt'.
  1687.  
  1688.     If sending/receiving binary files use `xm rb' or `xm
  1689. sb' as the remote system's commands.  Note that files received with
  1690. Xmodem usually contain extraneous bytes at the very end of the file.
  1691. With text files, you often see a bunch of `^Z's.
  1692.  
  1693.     When both `sx_remote_cmd' and `rx_remote_cmd' are set
  1694. appropriately, it is possible to transfers of batches of files.  For example,
  1695.  
  1696.      sx D1/D2/F1 D1/F2
  1697.  
  1698. will invoke `xm rt' on the far end and send file `d1/d2/f1',
  1699. and after this is finished invoke `xm rt' once again and send the
  1700. second file `d1/f2'.  The `rx' command also can smilarly
  1701. take multiple arguments.
  1702.  
  1703.  
  1704. File: gulam.info  Node: set, Prev: rx, Up: Glossary, Next: setenv
  1705.  
  1706. set
  1707. ---
  1708.      set [NAME VALUE]
  1709.  
  1710. The built-in `set' command is used to assign new values to shell
  1711. variables and to show the values of the current variables.  The command
  1712. without any arguments lists all the shell vars and their values.  When
  1713. arguments are present, second and subsequent words are processed as an
  1714. expression yielding a value which is then assigned to the first argument.
  1715. The `unset' command deletes a variable.
  1716.  
  1717.      set i  {$j > 10 } # sets i to 1 if $j is > 10; else to 0
  1718.      set x "hi there" 
  1719.      set y $i + 4 @ 2   # @ stands for multiplication 
  1720.  
  1721.  
  1722. File: gulam.info  Node: setenv, Prev: set, Up: Glossary, Next: source
  1723.  
  1724. setenv
  1725. ------
  1726.  
  1727. Variables in the environment can be changed by using the `setenv'
  1728. built-in command.  The `setenv' command without args prints the values
  1729. of all the variables in the environment.
  1730.  
  1731.  
  1732. File: gulam.info  Node: source, Prev: setenv, Up: Glossary, Next: te
  1733.  
  1734. source
  1735. ------
  1736.      source FILE-NAME
  1737.  
  1738. The contents of file FILE-NAME are excuted by *Gulam*.
  1739. Unless the FILE-NAME has an extension other than `.g', use
  1740. the simpler command `file.g' instead.
  1741.  
  1742.  
  1743. status
  1744. ------
  1745.  
  1746. A command normally returns a status when it finishes.  By convention a
  1747. status of zero indicates that the command succeeded, and *Gulam*
  1748. does not show this value.  Commands may return non-zero status, whic is
  1749. displayed, to indicate that some abnormal event has occurred.  The shell
  1750. variable status is set to the status returned by the last command.
  1751.  
  1752.  
  1753. File: gulam.info  Node: strings, Prev: regular-expressions, Up: top, Next: file-name-completion
  1754.  
  1755. Strings
  1756. -------
  1757.  
  1758. Strings are the most common data type that shells deal with.  In
  1759. *Gulam*, unless otherwise stated, all operands are considered to be
  1760. strings.  There are a few occasions when it is necessary to suppress the
  1761. typical string preprocessing such as meta-char expansion.  Such strings are
  1762. enclosed in single-quotes.  A string enclosed in double quotes is dollar-,
  1763. and meta-expanded, and then enclosed in double quotes.  Try, `echo
  1764. *.c' and `echo '*.c'' in a directory that has a few files with the
  1765. `.c' extension.  Within a quoted-string, you can include control
  1766. characters by inserting a `' (control-Q) followed by the octal
  1767. ASCII code (always using 3 digits) of the character; see the `gulam.g'
  1768. section for examples.  In general, if you want to set a var to a string
  1769. that contains control-chars, first write it out in the C language notation,
  1770. and replace each back-slash with a `control-Q'.
  1771.  
  1772.  
  1773. File: gulam.info  Node: te, Prev: source, Up: Glossary, Next: time
  1774.  
  1775. te/teexit
  1776. ---------
  1777.  
  1778. `te' (also  bound to `Keypad-0') gets you into the built-in terminal
  1779. emulator.   If  you have baud_rate set up properly (see gulam.g),
  1780. the  rs232  port  is set to that speed, and you are switched to a
  1781. fresh  screen.   Set  `sz_rs232_buffer'  to  a  large  value if you
  1782. encounter  XON/XOFF  problems  too frequently.  We have  used the
  1783. following  TERMCAP  and  used  vi,  GNU-Emacs  etc  without  any
  1784. problems.  
  1785.  
  1786.      st|st25|atariST|bw, std sys font, 25 lines, 80 col:
  1787.         :ae=Eba:al=EL:am:as=Ebc:
  1788.         :bl=^G:bs:
  1789.         :cd=EJ:ce=EK:cl=EHEJ:cm=EY%+ %+ :co#80:cr=^M:
  1790.         :dl=EM:do=EB:
  1791.         :ho=EH:
  1792.         :is=EvEe:
  1793.         :kd=274:kh=216:kl=275:kr=276:ku=273:
  1794.         :le=^H:li#25:
  1795.         :nd=EC:nl=^J:
  1796.         :pt:
  1797.         :se=Eq:so=Ep:sr=EI:
  1798.         :ta=^I:
  1799.         :up=EA:
  1800.      
  1801.      
  1802.      ST|ST25|atariSTcolor|as above but with color for stndout:
  1803.         :ae=Eba:al=EL:am:as=Ebc:
  1804.         :bl=^G:bs:
  1805.         :cm=EY%+ %+ :co#80:li#25:cr=^M:cd=EJ:ce=EK:cl=EHEJ:
  1806.         :dl=EM:do=^J:
  1807.         :ho=EH:
  1808.         :is=EvEe:
  1809.         :kd=274:kh=216:kl=275:kr=276:ku=273:
  1810.         :le=^H:
  1811.         :nd=EC:nl=^J:
  1812.         :pt:
  1813.         :so=Ec2Eb3:se=Ec0Eb3:sr:EI:
  1814.         :ta=^I:
  1815.         :up=EA:
  1816.      
  1817.      sT|st50|AtariST emulating vt52, bw, 50 lines, 80 col:
  1818.         :ae=Eba:al=EL:am:as=Ebc:
  1819.         :bl=^G:bs:
  1820.         :cd=EJ:ce=EK:cl=EHEJ:cm=EY%+ %+ :co#80:cr=^M:
  1821.         :dl=EM:do=^J:
  1822.         :ho=EH:
  1823.         :is=EvEe:
  1824.         :kd=274:kh=216:kl=275:kr=276:ku=273:
  1825.         :le=^H:li#50:
  1826.         :nd=EC:nl=^J:
  1827.         :pt:
  1828.         :se=Eq:so=Ep:sr=EI:
  1829.         :ta=^I:
  1830.         :up=EA:
  1831.  
  1832. To return to the local mode after having done `te', press `UNDO'.
  1833. Then a `Keypad-0' will take you back to remote with your remote screen
  1834. in tact.  After you are finally done with your remote system, press
  1835. `UNDO', and then issue a `teexit' to reclaim the 32k used for the
  1836. extra screen.
  1837.  
  1838.  
  1839. File: gulam.info  Node: file-name-completion, Prev: strings, Up: top
  1840.  
  1841. Tenex File Name Completion
  1842. --------------------------
  1843.  
  1844. Tenex is widely considered to be the first OS to implement the completion
  1845. of a file's name given the first few chars of it.  Experiment with the keys
  1846. marked `INSERT', `TAB' and `CLR/HOME', while you are in
  1847. *mini*.  If you are in buffer *gulam*, use `ESC-ESC' (2
  1848. escapes).  See File Names.
  1849.  
  1850.  
  1851. File: gulam.info  Node: time, Prev: te, Up: Glossary, Next: touch
  1852.  
  1853. time
  1854. ----
  1855.  
  1856. The word `time' when prefixed to a regular command, it prints the
  1857. elapsed time after the command finishes.  If you set variable
  1858. named `time'  to  a non-zero value, each and every command, even
  1859. if  they  are  not  prefixed  with  the  word `time',  will be so
  1860. timed.  
  1861.  
  1862.      time  ls -lF c:\        # See how long it takes 
  1863.      set   time  1           # After this, all command will be timed until 
  1864.      set   time 0            # you do this, or 
  1865.      unset time              # this 
  1866.  
  1867. If you set up aliases with `time' prefixes in them, watch out!  The
  1868. discussion under the section on Gem is applicable to `time' also.
  1869.  
  1870.  
  1871. File: gulam.info  Node: touch, Prev: time, Up: Glossary, Next: ue
  1872.  
  1873. touch
  1874. -----
  1875.      touch FNMS
  1876.  
  1877. `touch'  updates  the  time  stamp on the files to current time and
  1878. date.  
  1879.  
  1880.  
  1881. File: gulam.info  Node: ue, Prev: touch, Up: Glossary, Next: uekb
  1882.  
  1883. ue
  1884. --
  1885.      ue [-r] [FNMS]
  1886.  
  1887. This command takes you into the built-in microEmacs editor.  If
  1888. no  args  are  given,  you  will  land  in  the  *gulam*  buffer,
  1889. otherwise in the buffer of the last named file.  The output of
  1890. *Gulam* commands executed while you are within *gulam* is
  1891. entered into that buffer; this, of course, consumes malloc-space.
  1892. `Meta-g' brings you into *gulam* if you are in another buffer.
  1893.  
  1894. To examine the key bindings, press `HELP'-key first, and then a `B'
  1895. while inside `ue'.  To rebind them to suit your tastes, see `kb'.
  1896. On the Atari ST, all the keys are bound (thoughtfully, I hope) to useful
  1897. commands.  `F1' through `F5' delete things; `F6-F10' update
  1898. files and buffers; Keypad keys cause harmless cursor motions; `Keypad
  1899. 0' (zero) switches you to the (remote computer hooked to the) rs232 port;
  1900. to return to your local Atari, press `UNDO'.  `HELP' is for (not
  1901. much) help; `UNDO' will exit after saving files; the rest of the keys
  1902. in that group move the cursor around.
  1903.  
  1904. The `-r' flag causes the buffers of the files following the `-r'
  1905. to be marked as read-Only.  You can still edit these buffers; but the
  1906. read-Only mark causes `ue' to ask before writing to these files.
  1907.  
  1908. Do try `^Z, ^X-!' and `Meta-X-!' commands.  
  1909.  
  1910.  
  1911. File: gulam.info  Node: uekb, Prev: ue, Up: Glossary, Next: unalias
  1912.  
  1913. uekb
  1914. ----
  1915.  
  1916. The command `uekb' has been renamed as `kb'.
  1917.  
  1918.  
  1919. File: gulam.info  Node: unalias, Prev: uekb, Up: Glossary, Next: unset
  1920.  
  1921. unalias
  1922. -------
  1923.      unalias [ALIASSED-NAME]
  1924.  
  1925. The unalias command removes aliases.   
  1926.  
  1927.  
  1928. File: gulam.info  Node: unset, Prev: unlalias, Up: Glossary, Next: which
  1929.  
  1930. unset unsetenv
  1931. --------------
  1932.      unset [VAR-NAME]
  1933.      unsetenv [ENV-VAR]
  1934.  
  1935. The unset command removes the definitions of shell variables.  
  1936.  
  1937.  
  1938. variables
  1939. ---------
  1940.  
  1941. See also: *Gulam* Vars and Environment; Dollar Subst.  
  1942.  
  1943. A variable name is any sequence of characters not containing delimiters.  A
  1944. Variable in *Gulam* holds a string as its value.  Depending on the
  1945. context this string is evaluated to yield a numeric value.
  1946.  
  1947.  
  1948. File: gulam.info  Node: which, Prev: unset, Up: Glossary, Next: while
  1949.  
  1950. which
  1951. -----
  1952.  
  1953. The `which' command displays the internal table of names of external
  1954. commands, and the full pathnames of the files that contain them.  If
  1955. nothing  gets  displayed,  either  you did not do a `rehash', did
  1956. not  setenv  the PATH, or none of the directories in PATH had any
  1957. executables.  
  1958.  
  1959.  
  1960. File: gulam.info  Node: while, Prev: which, Up: Glossary
  1961.  
  1962. while
  1963. -----
  1964.  
  1965. The `while' built-in control construct is used in shell command
  1966. scripts.  Instead of echo and set in the body of the loop shown below, you
  1967. can use other commands.
  1968.  
  1969.      set i 10 
  1970.      while  { $i >  0 } 
  1971.            echo $i 
  1972.            set i $i - 1 
  1973.      endwhile 
  1974.