home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 2 / fishmore-publicdomainlibraryvol.ii1991xetec.iso / dirs / line_457.lzh / Line / line.man < prev    next >
Text File  |  1991-02-14  |  13KB  |  331 lines

  1.  
  2.      LINE(1)                     USER COMMANDS                      LINE(1)
  3.  
  4.  
  5.  
  6.      NAME 
  7.           line - a shell with features reminiscent of csh 
  8.  
  9.      SYNOPSIS 
  10.           line [-a <maxaliases>] [-c <histsize>] [-d <dirstack>] 
  11.                [-f <ignorelist>] [-p <prompt>] [-s <startup>] 
  12.                [-t <tmpdir>] 
  13.  
  14.           line -h[elp] 
  15.  
  16.      DESCRIPTION 
  17.           ›3mline  ›0mis  a command interpreter meant to augment the regular
  18.           CLI environment with aliasing, history, file completion, and
  19.           some built-in commands.   The  result  is  a  quite  useable
  20.           subset of ›3mcsh ›0mfeatures, in under 20k.  
  21.  
  22.      OPTIONS 
  23.           Parameters may be given to ›3mline ›0mfrom the command line and/or
  24.           the  environment variable LINEOPTS (see ENVIRONMENT, below).
  25.           Values given for a parameter on the command  line  supercede
  26.           any for that parameter in LINEOPTS.  
  27.  
  28.           All  options  which  require additional arguments will first
  29.           look at the text immediately following the  option,  and  if
  30.           the  needed  parameter  is  not  found,  will  take the next
  31.           argument.   Upshot:  as  an  example,  both  "-ablarg"   and
  32.           "-a blarg" are valid syntax.  
  33.  
  34.           -a ›3mmaxaliases 
  35.                ›0mThe maximum number of aliases that can exist during the
  36.                session.   Space  for aliases is allocated dynamically.
  37.                Defaults to 20.  
  38.  
  39.           -c ›3mhistsize 
  40.                ›0mDefines the  size  of  the  history  cache.    A   full
  41.                line-length  buffer  is  allocated  for  each of these.
  42.                Default is 20.  
  43.  
  44.           -d ›3mdirstack 
  45.                ›0mThe depth of the directory stack used by push, pop, and
  46.                dirs.  One longword is used per entry.  Default is 5.  
  47.  
  48.           -f ›3mignorelist 
  49.                ›0mGives filename suffixes to ignore when  doing  filename
  50.                completion.   A  list  of  suffixes  can  be  given  by
  51.                separating the  suffixes  by  vertical  bars  (note  no
  52.                whitespace is  allowed  around  the vertical bar).  The
  53.                default is ""; a more useful one is ".o|~|.info".  
  54.  
  55.           -h[elp] 
  56.                Prints short synopsis of command line options.  
  57.  
  58.           -p ›3mprompt 
  59.                ›0mSets the user prompt for the session.  The  default  is
  60.                "%N> ".  The  various  per cent codes that have special
  61.                meaning for the prompt are described in PROMPT, below.  
  62.  
  63.  
  64.  
  65.                                       -1-
  66.  
  67.  
  68.      LINE(1)                     USER COMMANDS                      LINE(1)
  69.  
  70.  
  71.           -s ›3mstartup 
  72.                ›0mThe startup file  ›3mline  ›0mlooks  for  commands  in.    It
  73.                defaults  to  "s:.linerc".  This  file  can contain any
  74.                command that you  would  normally  enter  at  the  user
  75.                prompt,  and  comments  may  be added by putting a hash
  76.                mark ("#") as the first non-whitespace character  of  a
  77.                line.  
  78.  
  79.           -t ›3mtmpdir 
  80.                ›0mThe  directory  temporary  files (such as those used to
  81.                implement pipes) are stored in.  Defaults to "tmp:". It
  82.                is sufficient to assign tmp: instead, usually to ram:.  
  83.  
  84.      USAGE 
  85.        Aliasing 
  86.           A list  of  aliases  is  maintained  that  can  be  created,
  87.           modified,  or  destroyed  with  the  "alias"  and  "unalias"
  88.           builtins.  Aliases associate a string with a word.  Whenever
  89.           that word is the first one  in  a  command,  the  string  is
  90.           substituted for it, and the line is re-evaluated.  There are
  91.           some  special  character  combinations that can occur in the
  92.           strings: "!'" will be replaced by a quotation  mark  (handy,
  93.           since  many  times  alias  strings  will  need  to be quoted
  94.           themselves), and "!*", which puts  any  arguments  following
  95.           the  alias  in at that particular spot, instead of appending
  96.           them.  Multiple "!'" and "!*" are allowed.  
  97.  
  98.           Aliases may include other aliases within their  definitions,
  99.           but cycles or loops are not permitted.  
  100.  
  101.        Command Line Parsing 
  102.           Input  lines  are  first  broken  up  into  commands at pipe
  103.           symbols ("|") and command seperators (";").  Note  that  "|"
  104.           and  ";"  must  be  surrounded by space(s); this restriction
  105.           imposed  largely  because  the  vertical  bar  is  a   valid
  106.           character in  AmigaDOS  wildcards.   The resulting line then
  107.           has I/O redirection removed ("< file" and  "> file" -- space
  108.           is   optional   between   the  redirection  symbol  and  the
  109.           filename), and  inconsistencies  are  checked  for.      For
  110.           example,  both  output  redirection  and  a pipe to the next
  111.           command are illegal.  Null commands are not allowed.  
  112.  
  113.           Then, history substitution is performed on the first word in
  114.           each command.  For each substitution,  the  entire  line  is
  115.           re-evaluated from  the  beginning.   Alias expansion is then
  116.           attempted on  the  first  word  in  each  command.     Every
  117.           successful   expansion  will  also  cause  the  line  to  be
  118.           re-evaluated, WITHOUT HISTORY SUBSTITUTION.  
  119.  
  120.           Lastly, each command is checked to see if it is  a  built-in
  121.           function, and if so, it is executed.  Note built-in commands
  122.           like "cls" may be over-ridden by capitalizing all or part of
  123.           the word: "Cls" is not a built-in command.  
  124.  
  125.           Finally, the commands are executed using ARP's SyncRun().  
  126.  
  127.        Editing Keys 
  128.           ^I     Filename completion.
  129.  
  130.  
  131.                                       -2-
  132.  
  133.  
  134.      LINE(1)                     USER COMMANDS                      LINE(1)
  135.  
  136.  
  137.           ^J     Accept input line.
  138.           ^M     Same as ^J.
  139.           ^Q     Quits from line.  See also the "exit" builtin.
  140.           ^U     Erases the current input line.
  141.           ^X     Same as ^U.
  142.           ^W     Erases the previous word.
  143.  
  144.        Filename Completion 
  145.           Pressing ^I  will  engage  filename  completion.   ›3mline ›0mwill
  146.           attempt to match a partially typed  (or  even  non-existent)
  147.           filename with  one  in  the  directory.  The case of a match
  148.           will be changed to reflect that of the actual filename.   If
  149.           an  unambiguous  match  cannot be made, the longest possible
  150.           unambiguous part will be returned.  Filenames  with  certain
  151.           suffixes  can  be  ignored;  see the description of the "-f"
  152.           command line argument for details.  
  153.  
  154.        History Substitution 
  155.           A history of commands is maintained by ›3mline ›0mup  to  a  limit
  156.           set by  the  "-c"  command  line argument (default 20).  The
  157.           history mechanism allows  these  to  be  referenced  on  the
  158.           current command  line.    The first word of every command is
  159.           examined, and if it is one of several forms, the appropriate
  160.           substitution is made, any arguments  following  the  history
  161.           reference  are  appended to the new command, and the line is
  162.           re-evaluated.  The history forms are: 
  163.  
  164.           !!  
  165.                Refers to the previous command.  Any text in  the  word
  166.                following this is appended to the substituted command.  
  167.  
  168.           !n 
  169.                Refers to  command  number  ›3mn.   ›0mAny text following the
  170.                number is appended to the substituted command.  
  171.  
  172.           !-n 
  173.                Refers to the current command line minus ›3mn.  ›0mAs before,
  174.                text following the number is appended.  "!-1" and  "!!"
  175.                are equivalent forms.  
  176.  
  177.           !str 
  178.                Refers to the last command line containing ›3mstr.  
  179.  
  180.           ›0m^m^n 
  181.                Refers   to   the  last  command  line,  but  with  all
  182.                occurances of ›3mm ›0mreplaced with ›3mn.  n  ›0mmay  be  the  null
  183.                string,  in which case all occurances of ›3mm ›0mare deleted.
  184.                Optionally, this form may be followed by a carat.   The
  185.                carat  is  ignored,  but any text in the word following
  186.                the carat is appended to the substituted command.  
  187.  
  188.           The "history" builtin may be used  to  display  the  current
  189.           contents of the history cache.  
  190.  
  191.        I/O Redirection 
  192.           ›3mline ›0msupports the redirection of standard input and standard
  193.           output, as well as a command pipeline facility.  
  194.  
  195.  
  196.  
  197.                                       -3-
  198.  
  199.  
  200.      LINE(1)                     USER COMMANDS                      LINE(1)
  201.  
  202.  
  203.           < ›3mfile 
  204.                ›0mTake input  for  the  command  from ›3mfile.  ›0mThe space is
  205.                optional after the "<". Input re-direction may occur at
  206.                any position after the first word of a command.  
  207.  
  208.           > ›3mfile 
  209.                ›0mRedirect the standard output of the  command  to  ›3mfile.
  210.                ›0mIf  the  file  does  not  exist,  it  is created; if it
  211.                exists, its former contents are overwritten.    As  for
  212.                input  redirection,  the  space between the ">" and the
  213.                filename is optional, and it may be placed at any place
  214.                except for the first word of a command.  
  215.  
  216.  
  217.      BUILT-IN COMMANDS 
  218.           alias 
  219.           alias <name> 
  220.           alias <name> <string> 
  221.                The first  form  prints  a  list  of  all  the  aliases
  222.                currently known  to  the  shell.  The second prints out
  223.                the definition of a particular alias.  The last creates
  224.                a new alias or changes the definition of  an  old  one.
  225.                See USAGE for details on aliases.  
  226.  
  227.           cls 
  228.                Clears the screen.  
  229.  
  230.           dirs 
  231.                Prints the  contents of the directory stack.  The first
  232.                name printed is at the top of the stack.  
  233.  
  234.           exit 
  235.                Exits from ›3mline.  
  236.  
  237.           ›0mhistory 
  238.                Prints the contents of the history cache.  
  239.  
  240.           pop 
  241.                Makes the top entry in the directory stack the  current
  242.                working directory.  
  243.  
  244.           push 
  245.                Pushes the current working directory onto the directory
  246.                stack.  
  247.  
  248.           unalias [<name> ...] 
  249.                Removes aliases from the alias list.  
  250.  
  251.           ver 
  252.                Prints the  version  number and author of ›3mline.  ›0mUse it
  253.                now.  Use it often.  
  254.  
  255.      PROMPT 
  256.           In addition to regular characters, the  prompt  may  contain
  257.           any of the following special codes: 
  258.  
  259.           %b     The basename of the current working directory.
  260.           %c     The current command number.
  261.  
  262.  
  263.                                       -4-
  264.  
  265.  
  266.      LINE(1)                     USER COMMANDS                      LINE(1)
  267.  
  268.  
  269.           %e     The ASCII escape character.
  270.           %h     The ASCII backspace character.
  271.           %i     The ASCII tab character.
  272.           %n     The ASCII newline character.
  273.           %p     The full pathname of the current working directory.
  274.           %N     The CLI number.
  275.  
  276.           Any  unrecognised  escapes  (including  "%%")  expand to the
  277.           escaped character.  
  278.  
  279.      ENVIRONMENT 
  280.           As opposed to typing them at the command line, arguments  to
  281.           ›3mline  ›0mmay  be  placed  in  the environment variable LINEOPTS
  282.           (ARP's GetEnv() routine is used to get the  variable;  while
  283.           it   recognises  Manx-style  environment  variables,  it  is
  284.           recommended  that  Commodore's  ENV:  be  used  for   future
  285.           compatibility).   LINEOPTS is filtered through ARP's GADS as
  286.           well, so any features inherent to it can be used.  
  287.  
  288.           A problem arises regarding how to place the quote  character
  289.           into an  environment  variable.    It  can  be  put there by
  290.           escaping  it  with  an  asterisk  ("*").  For  example,   my
  291.           ›3mStartup-Sequence ›0mincludes the line: 
  292.  
  293.           setenv LINEOPTS "-p *"%c %b >*" -f *".o|~|.info*""
  294.  
  295.      AUTHOR 
  296.           John Aycock, 1990. See copyright notice for restrictions.  
  297.  
  298.      FILES/DEVICES 
  299.           s:.linerc     Default startup file.
  300.           tmp:          Directory for temporary files.
  301.  
  302.      BUGS 
  303.           Shell scripts  should  be executed somehow.  Running ›3mExecute
  304.           ›0mdoesn't seem to work at all.  
  305.  
  306.           The number  of  arguments  in  an  environment  variable  is
  307.           limited to 20.  
  308.  
  309.           Crash  and burn will occur in history substitution and alias
  310.           expansion near the ends of long lines (256 bytes).  If  your
  311.           lines are this long, you probably deserve to crash.  
  312.  
  313.           Pathnames  (as  printed  by  the  %p  prompt option or dirs)
  314.           cannot be longer than 256 bytes, or a visit  from  the  GURU
  315.           will result.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.                                       -5-
  330.  
  331.