home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / utility / cli / sksh017.lzh / doc / Addendum1.7.doc < prev    next >
Encoding:
Text File  |  1991-05-04  |  31.2 KB  |  1,057 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.                        Addendum for Version 1.7
  17.  
  18.                                  SKsh
  19.  
  20.                     A ksh-like Shell for the Amiga
  21.  
  22.                               Version 1.7
  23.  
  24.  
  25.                          (Copyright) 1988-1991
  26.  
  27.                               Steve Koren
  28.  
  29.                               May 4, 1991
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.        Addendum to Version 1.7
  74.  
  75.      This  document  describes  additions and changes to SKsh  since
  76.      version 1.6.  Version 1.7 has many significant new features.
  77.  
  78.  
  79.      SKsh runs on 3000 systems
  80.  
  81.         SKsh now runs on  3000  systems, at least to the extent that
  82.         it no longer crashes  as  it  used  to.   When  2.0  becomes
  83.         widely  available  on  2000  systems, future SKsh's will run
  84.         only under AmigaDos 2.0.
  85.  
  86.  
  87.      "2" option added
  88.  
  89.         If  this  option flag is set, SKsh  will  attempt to execute
  90.         AmigaDos  2.0  internal  commands (but only if you are actu-
  91.         ally  running 2.0).  I have made this  an  option because in
  92.         SKsh  1.7,  executing AmigaDos 2.0  builtin commands doesn't
  93.         work  right.   I'll   probably fix it later when I have some
  94.         real  documentation on how the 2.0 calls  work.   Right  now
  95.         I'm just  trying to figure it out by looking at the function
  96.         prototypes, and that doesn't work very well.  This  flag  is
  97.         reset by default.
  98.  
  99.  
  100.      RECUR_DEPTH variable added
  101.  
  102.         RECUR_DEPTH is  a  variable which controls the maximum depth
  103.         that the SKsh parser  will  recurse.   Larger  values of RE-
  104.         CUR_DEPTH  require more stack space  but  enable more deeply
  105.         nested function calls, scripts, etc.
  106.  
  107.         This  variable is  described in more detail in the reference
  108.         manual.  Please see that document for details.
  109.  
  110.  
  111.      CDPATH variable added
  112.  
  113.         A  CDPATH  variable,  similar  to  PATH,  now  permits cd to
  114.         search  a  series  of  directories to find its  destination.
  115.         Any non-qualified path name will be searched for in all  di-
  116.         rectories in the  CDPATH.   The  new  1.7  path function can
  117.         modify the CDPATH as well as the PATH variable.
  118.  
  119.         Also, many  people  do  not  realize that the mplist command
  120.         can  provided  a  shortened  method  to  "cd"  to  different
  121.         directories.  For example, you can have the command:
  122.  
  123.           cd d1
  124.  
  125.         really mean:
  126.  
  127.  
  128.  
  129.        SKsh Amiga Shell             Page 2              Addendum to 1.7
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.           cd sys:usr/commands/src/cmd1/directory-one
  141.  
  142.         by adding the following line to your .skshrc file:
  143.  
  144.           mplist -a 'd1=sys:usr/commands/src/cmd1/directory-one'
  145.  
  146.  
  147.      MANPATH variable added
  148.  
  149.         MANPATH  is  similar to  CDPATH, but for the man script (see
  150.         description  below).  The new  path function also is able to
  151.         modify the MANPATH variable.
  152.  
  153.  
  154.      man script has additional abilities
  155.  
  156.         The  man  command, which is now  a  script,  has  additional
  157.         abilities.  It will now  search  for  files  ending in .MAN,
  158.         .doc, or .txt, and will search in any  number of directories
  159.         for the files.  This is  controlled by the MANPATH variable,
  160.         described above.
  161.  
  162.  
  163.      SKsh documentation available though manpages
  164.  
  165.         The  contents of the Reference.doc and ExtCmds.doc files are
  166.         now  available  though  the  man command.  The  new  install
  167.         script  (see  below) will  optionally create the manpage en-
  168.         tries  from  these  files  by  deleting the page headers and
  169.         footers,  and  breaking the .doc files into separate manpage
  170.         entries.
  171.  
  172.  
  173.      line builtin added
  174.  
  175.         A  line  command has been added  which  functions similar to
  176.         read,  but  allows the use of the full SKsh command line ed-
  177.         iting  facilities to input lines.  line may only input lines
  178.         from the keyboard, not a file.  The syntax is:
  179.  
  180.           line var [ prompt ] [ pnpc ]
  181.  
  182.         Where  pnpc  is  similar to the  PNPC variable, but for this
  183.         prompt.  (See the PNPC entry in Reference.doc for details).
  184.  
  185.         line  is  recommended  instead of  read wherever input is to
  186.         always be read from the keyboard.
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.        SKsh Amiga Shell             Page 3              Addendum to 1.7
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.      skshbin: and skshscr: aliases added
  207.  
  208.         In  addition to the old sksh:, two new aliases are  required
  209.         to run sksh properly.  These aliases point to the  directory
  210.         containing   the   SKsh   external  binaries,  and  scripts,
  211.         respectively.  This change  will  more  closely  standardize
  212.         SKsh environments.  Both of these aliases are added  to  the
  213.         SKsh path  by  default, so they need not be further added in
  214.         an .skshrc file.
  215.  
  216.  
  217.      xargs command added
  218.  
  219.         The new  xargs command is similar to the Unix command of the
  220.         same name.   xargs can be used to circumvent the 255 charac-
  221.         ter  command  line  length  limitation  in  AmigaDos.  xargs
  222.         reads  its  standard input, which should be a list of files,
  223.         and  executes  commands  multiple times on these files.  The
  224.         standard  input is produced by either the SKsh find utility,
  225.         or  more  commonly, the echo builtin.  Since echo is a shell
  226.         builtin, it can  handle  any  number of files.  For example,
  227.         suppose you have 100 .c files  in  a  directory.   Normally,
  228.         you  could  only  fgrep through 30 of these, since  AmigaDos
  229.         will  not  permit a command line longer than that.  However,
  230.         with xargs:
  231.  
  232.           echo *.c | xargs fgrep -il mytext
  233.  
  234.         xargs  will  properly construct several fgrep command lines,
  235.         each up  to  250  characters in length.  As another example,
  236.         suppose you wish to copy those files to ram:.   The  -i  op-
  237.         tion to fgrep tells it  to  substitute file names for the {}
  238.         parameter:
  239.  
  240.           echo *.c | xargs -i 'cp {} ram:'
  241.  
  242.         xargs  supports many  more  options and can do other things.
  243.         See  the  documentation  entry in  the  ExtCmds.doc file for
  244.         more  detailed information on xargs.  It supports all of the
  245.         Unix options, plus several more.
  246.  
  247.  
  248.      File completion is faster
  249.  
  250.         File name  completion performance has been improved on large
  251.         directories.   This   improvement will be most  noticed when
  252.         the  machine is heavily loaded.  Disk seek time can still be
  253.         an  overriding  factor,  but  for  directories   which   are
  254.         buffered or on a ram disk, completion  is  up  to  twice  as
  255.         fast.
  256.  
  257.  
  258.  
  259.  
  260.  
  261.        SKsh Amiga Shell             Page 4              Addendum to 1.7
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.      complist bug fixed
  272.  
  273.         If you add  a  device name ending in ":" to your "complist",
  274.         and  use  file  completion to insert the name on the command
  275.         line, SKsh will no longer insert a trailing "/".
  276.  
  277.  
  278.      Command line editing bug fixed
  279.  
  280.         The  "ILP"  command (insert last parameter), normally mapped
  281.         to "<esc> .", will no  longer  insert a ">" sign if it finds
  282.         one  as  the  first  character of the last parameter.   This
  283.         means that if your  previous command line ends with ">file",
  284.         and you use the  ILP  command, only "file" will be inserted,
  285.         without the ">" sign.  This is more often desired.
  286.  
  287.  
  288.      PNPC2 variable added
  289.  
  290.         A  PNPC2  variable has been added.  It is identical in func-
  291.         tion  to  PNPC  except that  it  functions for the secondary
  292.         prompt string.   This  enables you to have different numbers
  293.         of  escape  sequences in  your  primary and secondary prompt
  294.         strings.
  295.  
  296.  
  297.      Default prompt string changed
  298.  
  299.         The  default prompt string, set up in  .skshinit,  has  been
  300.         changed  to  include the history line number and cli number.
  301.         If  you  reset the prompt in your .skshrc, you will not  see
  302.         this change.
  303.  
  304.  
  305.      numloop statement added
  306.  
  307.         A  new  statement,  similar to the old "for"  statement, has
  308.         been  added.   The  new   numloop statement allows iteration
  309.         over a  range  of  numbers simply without using a while loop
  310.         and  inc  statement.   Iterations can be up or down, and can
  311.         step by 1 or a predefined amount.
  312.  
  313.         This  new   statement  is  described  in  the  Reference.doc
  314.         document.  Please see that description for more detail.
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.        SKsh Amiga Shell             Page 5              Addendum to 1.7
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.      history command enhanced
  338.  
  339.         The  history command now has additional abilities.  The his-
  340.         tory list can be cleared  using "history -c".  More signifi-
  341.         cantly,  history can now be saved and loaded to  files.   To
  342.         save  a  history list  to  a  file,  simply execute "history
  343.         >histfile".  To  reload the history from the file, using the
  344.         "-l"  option to  history: "history -l <histfile".  This will
  345.         reload  the  exact  history  state,  including the value  of
  346.         $CMDNUM.   This  feature is often useful to save the history
  347.         stack  between  executions of SKsh.  A set  of  scripts  has
  348.         been provided to facilitate history saving and loading;  see
  349.         the section below on the hist* scripts.
  350.  
  351.  
  352.      pathconv command added
  353.  
  354.         A  new  pathconv  command can  be  used  to  convert between
  355.         AmigaDos and Unix style filenames.   For  example, 'pathconv
  356.         -u "//foo"'  might  return  "../../foo",  and  'pathconv  -a
  357.         "../../foo"' would return "//foo".
  358.  
  359.  
  360.      Support for ${param:-word} variable expansions added
  361.  
  362.         Unix ksh  supports several methods to test for variable val-
  363.         ues and  perform variable expansions at the same time.  SKsh
  364.         now supports a few of these:
  365.  
  366.           ${var}       - Like $var, but ${a}text can be used to  ex-
  367.                          pand $a in front of  "text",  since  $atext
  368.                          would  try  to  expand the "atext" variable
  369.                          instead of the "a" variable.
  370.  
  371.           ${#var}      - Expands to the text length of $var
  372.  
  373.           ${var:-word} - Expands to $var if $var is set.   Otherwise
  374.                          expands  to  word,  which  may  itself be a
  375.                          variable (as in ${FOO:-$PWD} ).
  376.  
  377.           ${var:=word} - Similar to  ${var:-word},  but  assigns the
  378.                          result to "var" if it is  not  already set.
  379.                          Useful for  assigning defaults to variables
  380.                          while simultaneously using the result.
  381.  
  382.  
  383.      Input/output redirection to same file doesn't clobber file
  384.  
  385.         In  previous SKsh  versions, if a pipeline of the form "com-
  386.         mand <file >file" was run, were "file"  was  the  same  file
  387.         for both the  input and output of the pipeline, the file was
  388.         clobbered  before  an  error  message was issued.   This  no
  389.         longer happens and the file is left intact after the error.
  390.  
  391.  
  392.  
  393.        SKsh Amiga Shell             Page 6              Addendum to 1.7
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.      Added -n flag to disable .skshrc, .skshinit
  405.  
  406.         SKsh can now  be  started  using the -n flag, which tells it
  407.         to  ignore any .skshrc and  .skshinit  files  which  may  be
  408.         present.  This is not  normally useful for interactive invo-
  409.         cations of SKsh, but  it  may  occasionally be useful to run
  410.         simple scripts which do not require either setup file.
  411.  
  412.  
  413.      Usage message added to all builtins, extern cmds, scripts
  414.  
  415.         All  SKsh  builtin  commands, external binaries, and the new
  416.         scripts (see  description below) now will print a usage mes-
  417.         sage if given '-?' as the first  parameter with no other pa-
  418.         rameters present.  (The  '-?'  should  probably be quoted to
  419.         avoid  being interpreted as wildcards by the shell expansion
  420.         mechanism).   An   additional and slightly  more  convenient
  421.         method  to  generate the usage messages uses the new "usage"
  422.         script, described below.
  423.  
  424.  
  425.      Lisp like car, cdr functions added
  426.  
  427.         Two new shell  builtins (car and cdr) can be used to extract
  428.         elements  from  strings  containing lists of elements.   The
  429.         default  separator  character is a space, but  this  can  be
  430.         changed  with  an  additional option.  For an example of how
  431.         to use these  new  functions, see the new definitions of the
  432.         directory stack scripts (pushd, popd, and dstack).
  433.  
  434.  
  435.      File completion bug fixed
  436.  
  437.         File  completion no longer writes a "0" to  memory  location
  438.         "0".
  439.  
  440.  
  441.      toupper/tolower/capital builtins added
  442.  
  443.         New  builtins have been added  which  are  similar to "echo"
  444.         but  echo  arguments in  upper case, lower case, or with the
  445.         first  letter of each  argument capitalized.  These commands
  446.         took very little space to add since  they  share  code  with
  447.         the "echo" builtin.
  448.  
  449.  
  450.      New supported scripts added
  451.  
  452.         Several  scripts  which  were   previously  shipped  in  the
  453.         Stuff.sksh file have  been  removed, and are now supplied as
  454.         a  "standard" part of SKsh as stand alone scripts.  In addi-
  455.         tion, several new scripts have been added (see below).
  456.  
  457.  
  458.  
  459.        SKsh Amiga Shell             Page 7              Addendum to 1.7
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.         This  approach  has  several advantages.  First, as scripts,
  470.         they are only in memory when you need  them,  as  opposed to
  471.         functions which take up ram all the time even if  you  don't
  472.         often  invoke them.   Second, this approach reduces the time
  473.         necessary  to  invoke  SKsh,  since  the  functions are  not
  474.         loaded  then.  Third, I  can  integrate these functions with
  475.         the rest of SKsh, document them in Reference.doc, etc.
  476.  
  477.         These  scripts  will  have  to  be  installed in a directory
  478.         pointed to by the new  skshscr: alias.  The new installation
  479.         script  will  perform this  task  for  you.   (See  the  new
  480.         "Install.doc"  for  details).  It is possible to break these
  481.         scripts  by  changing  values  of  certain SKsh options.  In
  482.         particular, i, l, and  N  are  dangerous, and I don't recom-
  483.         mend you change them from their  defaults if you wish to use
  484.         these scripts.
  485.  
  486.         Some lesser used  functions are left in the Stuff.sksh file,
  487.         while  others  are  now  standalone scripts.   The  list  of
  488.         scripts is contained in the  ReadMe_1st.doc  file.   Scripts
  489.         are also now documented in Reference.doc.
  490.  
  491.  
  492.      Usage script added
  493.  
  494.         A  new  usage script can be used to print the usage messages
  495.         from any SKsh  builtin, script, or external binary.  For ex-
  496.         ample, "usage history" results in:
  497.  
  498.           Usage: history [ -n ] [ >histfile ]
  499.                  history -e [ pattern | number | offset ]
  500.                  history -c
  501.                  history -l <histfile
  502.  
  503.         The  usage command may also be used to  print  usage message
  504.         for  any  other  AmigaDos  command which will accept '-?' as
  505.         the first parameter and print a usage message as a result.
  506.  
  507.  
  508.      chext script added
  509.  
  510.         A  new  external script  called  chext can be used to rename
  511.         files to  use  different extensions.  For example, "chext .c
  512.         *.bak" would change all files ending in .bak to end in .c.
  513.  
  514.  
  515.      histsave, histload, histlist, histrm scripts
  516.  
  517.         Four new  scripts  facilitate  the  use  of  history  files.
  518.         histsave  save  the  current  history  in   a   file   named
  519.         s:SKsh_Hist.<n>, where <n> is the $CLINUM by default or  any
  520.         other  string.    histload loads a previously saved  history
  521.         file.    histlist lists available history files, and  histrm
  522.         deletes all saved history files.  For example:
  523.  
  524.  
  525.        SKsh Amiga Shell             Page 8              Addendum to 1.7
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.           [prompt]: histsave compile
  537.           [prompt]: histsave session2
  538.           [prompt]: histlist
  539.               compile
  540.               session2
  541.  
  542.         See the  documentation  in  Reference.doc for information on
  543.         these functions.
  544.  
  545.  
  546.      && and || support
  547.  
  548.         Unix  ksh  supports linking commands with && and ||.  In the
  549.         first form,  the  right  side  is  executed only if the left
  550.         side is successful.   In  the  second, only if not.  This is
  551.         useful,  for  example, to copy and remove a file if the copy
  552.         was successful:
  553.  
  554.           copy myfile mydir && rm myfile
  555.  
  556.         or to execute function clean_up if function my_func failed:
  557.  
  558.           my_func param_1 param_2 || clean_up
  559.  
  560.         Any  number  of  control  structures may be chained together
  561.         using && and ||,  although chaining large numbers may neces-
  562.         sitate  increasing  the  RECUR_DEPTH variable.  The  use  of
  563.         these   operators  is   described  in  more  detail  in  the
  564.         UserMan.doc file.
  565.  
  566.  
  567.      split command added
  568.  
  569.         A  new  external  split  command can be used to  split  text
  570.         files into smaller files  with  a  given  number of lines in
  571.         each file.   This  is  sometimes useful for dealing with un-
  572.         wieldy  uuencoded files or text files too large to  comfort-
  573.         ably edit in one piece.  The files can be re-assembled  with
  574.         the  external  cat  or  join commands.  See the  ExtCmds.doc
  575.         file for information on using split.
  576.  
  577.  
  578.      File completion, commands work with spaces in filenames
  579.  
  580.         The  file  completion  mechanism has been enhanced to insert
  581.         backslash  escapes  before spaces if the filename being com-
  582.         pleted  contains imbedded spaces.  A backslash escaped space
  583.         will also no longer break parameters, so that:
  584.  
  585.           ll my\ file
  586.  
  587.         will correctly list the file named "my file".
  588.  
  589.  
  590.  
  591.        SKsh Amiga Shell             Page 9              Addendum to 1.7
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602.      exit code can now be set from a script or function
  603.  
  604.         The  old  SKsh  return builtin would not permit an exit code
  605.         to  be  returned from a script or  function.   The  new  one
  606.         does,  but  introduces a slightly different meaning.  return
  607.         with  no  parameters  functions as it did before.  With  one
  608.         parameter,  <n>,  return sets the return code to <n> and re-
  609.         turns one  level  (it  used  to  return <n> levels).  Return
  610.         with two  parameters, <n> and <l>, sets the exit code to <n>
  611.         and returns <l> levels.
  612.  
  613.         This new  feature permits one to test the return code from a
  614.         function:
  615.  
  616.           function foo {
  617.              if [ <some condtion> ]
  618.              then return 1
  619.              else return 0
  620.              fi
  621.           }
  622.  
  623.           if foo
  624.           then <action>
  625.           else <action-1>
  626.           fi
  627.  
  628.  
  629.      mkdir builtin supports -p option
  630.  
  631.         mkdir  now  supports the -p option.   mkdir -p followed by a
  632.         full  path  name  will  create all  directories necessary to
  633.         make  the  path.   For   example, suppose that the directory
  634.         ram:foo  exists and is empty.   "mkdir -p ram:foo/bar/tst/a"
  635.         would     create    ram:foo/bar,    ram:foo/bar/tst,     and
  636.         ram:foo/bar/tst/a all in one step.   In  addition,  it  will
  637.         issue no error codes for directories it cannot make.
  638.  
  639.  
  640.      tackon builtin added
  641.  
  642.         The  new  tackon builtin will assemble its parameters into a
  643.         complete  path,  inserting "/" characters where needed.  For
  644.         example,  "tackon   ram:   make/   a   path"   would   yield
  645.         "ram:make/a/path".  In  addition, a -e option will backslash
  646.         escape any wildcard or whitespace characters.
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.        SKsh Amiga Shell            Page 10              Addendum to 1.7
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.      skshbin: and skshscr: added
  668.  
  669.         These two aliases point to  the  location of the SKsh exter-
  670.         nal  binaries and scripts, respectively.  These are included
  671.         in  the  SKsh  default search path, so you will not have  to
  672.         add them in your .skshrc file as  was  necessary with previ-
  673.         ous SKsh versions.  If your .skshrc file added the  external
  674.         binary  directory,  it  should  be  modifed to no longer  do
  675.         this.  In  addition, you will need to change your s:startup-
  676.         sequence file to create these aliases.
  677.  
  678.  
  679.      [ expr ] style expressions can be used independently
  680.  
  681.         Previously, [ expr ] clauses needed to be used  in  "if"  or
  682.         "while" loops.  They can now be  used  independently, a fea-
  683.         ture  which  is  useful when combined with the '&&' and '||'
  684.         operators  mentioned above.  For example, the following line
  685.         sets  the  "f"  variable to be  ram:foo  only  if  the  file
  686.         ram:foo exists, and echos "Hi!":
  687.  
  688.           [ -f ram:foo ] && f='ram:foo' && echo 'Hi!'
  689.  
  690.         This is  usually more compact than using an if statement for
  691.         one or two small operations.   There  is  currently a bug in
  692.         that [ expr ] will not set the $? variable.  It  will,  how-
  693.         ever,  return  the  correct true/false value, as seen in the
  694.         above example.  The use of  this  feature  is  described  in
  695.         more detail in the UserMan.doc file.
  696.  
  697.  
  698.      path function removed, changed to script
  699.  
  700.         The  path function has been removed and changed to an exter-
  701.         nal  script.   This   reduces in invocation time and memory,
  702.         and  since  the  path function in only invoked infrequently,
  703.         the  time  overhead of the script is not large.   This  also
  704.         permits the path  function to be more complex and understand
  705.         the CDPATH variable (see below).
  706.  
  707.  
  708.      path script understands CDPATH and MANPATH as well as PATH
  709.  
  710.         The new  -cd and -man options to the path script tells it to
  711.         change  the  CDPATH or MANPATH instead of the PATH.  The old
  712.         -add  option can be used  with  or  without the -cd and -man
  713.         options.  For example,
  714.  
  715.           path -cd -add /users /usr/pd
  716.           path -man -add MAN:subdir1
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.        SKsh Amiga Shell            Page 11              Addendum to 1.7
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.      expr -a and -o use short circuit evaluation
  734.  
  735.         -a (and) and  -o  (or)  clauses  in  expr statements now use
  736.         short  circuit  evaluation, which means they  only  evaluate
  737.         the parts of  the  expression they need to.  (For example in
  738.         "[ 2 -lt 0 -a 3 -lt 9 ]", only the "2 -lt  0"  part  of  the
  739.         expression  is  evaluated,  since  because it is false,  the
  740.         value of the "3 -lt 9"  expression does not matter in deter-
  741.         mining the  final result.  This is faster, and mostly trans-
  742.         parent, but I  mention it here because it is possible to see
  743.         slightly  differences if the  expressions have side effects.
  744.         This should affect very few scripts.
  745.  
  746.  
  747.      Parameters may be passed to scripts from other shells
  748.  
  749.         SKsh  has  always had the  ability to run scripts from other
  750.         shells.   For   example, you might have scripts from "ARexx"
  751.         or  "CShell"  (originally by Matt Dillon and recently worked
  752.         on  by  Urban  Mueller).    However, there was  previously a
  753.         limitation  in  that  no  arguments could be passed to these
  754.         scripts.   Auto-shell   sourcing will now  pass  parameters.
  755.         For  example,  consider the  "phonebook.rexx"  script  which
  756.         comes with ARexx.  If you modify  the  first  two  lines  to
  757.         read:
  758.  
  759.           /*c:rx
  760.           */
  761.  
  762.         You can then run  this  script  directly from SKsh (provided
  763.         it is in your search path and the script bit is  set).   For
  764.         example:
  765.  
  766.           phonebook.rexx bill
  767.  
  768.         will  execute  the  "phonebook" rexx command with "bill"  as
  769.         one parameter.
  770.  
  771.  
  772.      SKsh message file
  773.  
  774.         The text of  SKsh  error, help messages, usage messages, and
  775.         some  default information is now stored in a file and loaded
  776.         at  run  time.   This  allows the messages to be customized.
  777.         The file will only be read by the  first  SKsh  invoked (see
  778.         "Shared SKsh modes" below).
  779.  
  780.         The  message file is named "sksh.msg" and MUST  exist in ei-
  781.         ther the "sksh:"  directory or in $PWD.  (It will usually be
  782.         in "sksh:").  If it is not found, SKsh WILL  NOT  RUN.   The
  783.         Install_1.7.pp  script  will  correctly  install this  file.
  784.         The  format of the message file is fairly unforgiving of er-
  785.         rors,  and  it  is  explained  in  detail in the UserMan.doc
  786.         file.
  787.  
  788.  
  789.        SKsh Amiga Shell            Page 12              Addendum to 1.7
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.  
  801.      Shared SKsh Modes
  802.  
  803.         SKsh  now  supports three shared modes, known  as  "slightly
  804.         shared",  "somewhat shared",  and  "very  shared".   In  the
  805.         shared  modes,  every SKsh  run  after the first will detect
  806.         that there  are  other  shells  running, and share some data
  807.         with the  original shell.  This will result in a memory sav-
  808.         ings of up to 25K per shell, and can also make  shell  invo-
  809.         cation nearly  instantaneous.   Using "very shared" mode can
  810.         reduce  startup time to less  than  a  second for a resident
  811.         SKsh, since nearly all data  is  inherited from another run-
  812.         ning shell and no initialization files need be read.
  813.  
  814.         There  are  several  important things to  note  about  using
  815.         shared modes with SKsh.  Please  read  the  appropriate sec-
  816.         tions of UserMan.doc and Bugs.doc if you plan to  use  these
  817.         modes.
  818.  
  819.  
  820.      SHARED_TYPE variable
  821.  
  822.         This  variable  contains the string 'master' if this SKsh is
  823.         the shared master.  If so, this shell  must  exit  after any
  824.         slave shells.
  825.  
  826.  
  827.      OS_VER variable
  828.  
  829.         This  variable  contains  either the string  '1.3',  or  the
  830.         string  '2.0',  depending on  the  version of AmigaDos under
  831.         which the shell is being run.
  832.  
  833.  
  834.      New install script added
  835.  
  836.         A  new  install script, called  Install_1.7.sksh can be used
  837.         to  assist with SKsh  installation or update.  (It functions
  838.         whether or  not  there  is  already an SKsh installed on the
  839.         system).
  840.  
  841.         To use this script, the SKsh  distribution archive should be
  842.         extracted  to  a  directory,  preferably on ram: if you have
  843.         the space.  The script will ask you  several questions about
  844.         the  intended  locations of your SKsh files (and if you  al-
  845.         ready  have  the  sksh:,  skshbin:, and skshscr: aliases as-
  846.         signed, it will use  these  as  defaults).  It will then in-
  847.         stall the SKsh  files  in  their  proper  locations, set the
  848.         proper  permission  bits,  check  the  values of your sksh*:
  849.         aliases,   checksum  the   destination  files,  install  the
  850.         manpages,  and  generate  a  checklist of  additional manual
  851.         tasks which may be  necessary (such as modifications to your
  852.         s:startup-sequence file).
  853.  
  854.  
  855.        SKsh Amiga Shell            Page 13              Addendum to 1.7
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.  
  866.         The  script  MUST  be  invoked from the directory containing
  867.         the  unarchived SKsh files, and  it  MUST  be  run  from  an
  868.         AmigaDos CLI as follows:
  869.  
  870.           1> sksh -n Install_1.7.pp
  871.  
  872.         The  -n  parameter is important.  Also, both .pp and regular
  873.         forms of  the  script  are  provided.   The  .pp  version is
  874.         faster and you should run that.  The  other  is  provided in
  875.         case  you  wish  to  examine the script (which  is  somewhat
  876.         long).
  877.  
  878.         This  script  is  probably  only  useful for installing SKsh
  879.         onto a hard disk.  I have not  tested  it  for  installation
  880.         onto a floppy.
  881.  
  882.         Please read  the  new  Install.doc file for more information
  883.         on the script.
  884.  
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901.  
  902.  
  903.  
  904.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.        SKsh Amiga Shell            Page 14              Addendum to 1.7
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.        Misc. Notes
  932.  
  933.      The Install.doc file has changed substantially from  SKsh  1.6.
  934.      Please read it again before installing  1.7.   The  Install.doc
  935.      file now mostly explains the install script.  Far fewer  manual
  936.      actions  are  necessary to  install a new SKsh or update an old
  937.      one than with SKsh  1.6.   Installation will get even easier in
  938.      future versions.
  939.  
  940.      I am  no  longer  distributing a "zoo" file for SKsh.  There is
  941.      now only a "lharc" archive.  Also,  the  archive  contains sev-
  942.      eral  subdirectories - it is best to use  the  "-m"  switch  to
  943.      "lharc" to have it  create these directories without prompting.
  944.      The new  install script expects all files to be in their proper
  945.      subdirectories, and it  will  complain if they are not.  There-
  946.      fore, if you  upload SKsh to bulletin board systems, give it to
  947.      friends,  etc,  it  is  imperative that the  EXACT .lzh file is
  948.      transferred.
  949.  
  950.      My  email  address has  changed  since  1.6.   Please  see  the
  951.      MiscInfo.doc file for the new address.
  952.  
  953.      The following line can  be  used  in  a  "view.magic"  file  to
  954.      detect SKsh preparse files:
  955.  
  956.           SKsh preparse file:OFFSET:0:28534B53485F50502C....29
  957.  
  958.      I would like to make  a  request of people who further distrib-
  959.      ute  SKsh  (uploading it to BBS's, etc).  I would  appricate it
  960.      if  you  distribute the  ORIGINAL SKsh archive, and not a reas-
  961.      sembled one.  There are  a  large  number of files present, and
  962.      getting  them  right  is  something of a tricky  business.   It
  963.      makes life easier  for  users down the road if they receive the
  964.      original archive, and the  Install_?.?.pp script is less likely
  965.      to  complain  about  missing or incorrect files.  Thanks!  That
  966.      said,  as  always, feel free to  give  SKsh  to  anyone who you
  967.      think might be interested.
  968.  
  969.      One  common  question people have is why short command lines do
  970.      not get added to the  history list.  You can control this using
  971.      the $LLMIN variable.  $MAXDIST  also  affects the way lines get
  972.      added  to  the  history list.  Check out the  documentation for
  973.      these variables in Reference.doc for details.
  974.  
  975.      Thanks are owed to Kent Polk and Jordan  Hubbard for help test-
  976.      ing  1.7,  to  Allen  Norskog for making his 3000 available for
  977.      testing  until I  managed to get an SKsh which which would more
  978.      or less run there, to Fred  Fish  for  continuing to provide an
  979.      invaluable  service  to  Amiga  users, to Tad Guy  for  posting
  980.      various  SKsh  versions to comp.binaries.amiga, and to everyone
  981.      else who provided ideas and suggestions for SKsh.
  982.  
  983.  
  984.  
  985.  
  986.  
  987.        SKsh Amiga Shell            Page 15              Addendum to 1.7
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.        Updating from SKsh 1.6
  998.  
  999.      There are several difference to note between 1.6 and 1.7:
  1000.  
  1001.      1)   The  return  command is now slightly different.  This  may
  1002.           affect some old scripts which  depend on the return n syn-
  1003.           tax  for  returning "n" nested levels.  (It  is,  however,
  1004.           more compatible with the Un*x return command now).
  1005.  
  1006.      2)   Your .skshrc file no longer should add the  directory con-
  1007.           taining  the  SKsh  external  binaries to the search path.
  1008.           Both  skshbin:  and  skshscr: are  included in the default
  1009.           SKsh search path.
  1010.  
  1011.      3)   You will  need  to  set  up  skshbin: and skshscr: in your
  1012.           s:startup-sequence file.
  1013.  
  1014.      4)   As  always, the new .skshinit file MUST be used.  The  .pp
  1015.           form will be faster.  The  install script will put the new
  1016.           .skshinit into your sksh:  directory.   Similarly, the new
  1017.           sksh.msg   message  file  must  be  placed  in  the  sksh:
  1018.           directory.  The install script will install this as well.
  1019.  
  1020.  
  1021.        SKsh users list
  1022.  
  1023.      I am  starting to keep a list of SKsh users.  If you wish to be
  1024.      on this list, send me your name, and  either a US-mail or email
  1025.      address where you can be reached.  One reason for this list  is
  1026.      just curiosity on my part of how many people  use  SKsh  (which
  1027.      determines, in  part,  how  much  effort I will continue to put
  1028.      into  it).   I  can't  promise there are any real advantages to
  1029.      being on this list, although I may  occasionally use it to send
  1030.      out news about SKsh, small patches,  or  interesting scripts or
  1031.      functions  which  don't  make   it   into   an   official  SKsh
  1032.      distribution.  Reply or not as you see fit.
  1033.  
  1034.  
  1035.        Notes about the size of SKsh
  1036.  
  1037.      I  have  been  attempting to keep the main SKsh binary close to
  1038.      70K bytes.   However, as I add more things, the whole SKsh dis-
  1039.      tribution grows larger.  Even in 1.7  I  have  omitted things I
  1040.      wished  to  include,  and  compressed other things, so that the
  1041.      distribution  can  be  unarchived on one floppy (just  barely).
  1042.      However,  future  versions  will  certainly be larger.  This is
  1043.      just  a  warning that  installing future SKshs will almost cer-
  1044.      tainly  require a hard disk or ram drive to store the distribu-
  1045.      tion files before they are installed.
  1046.  
  1047.      To save space, the files shipped in the  "misc"  directory (in-
  1048.      cluding   Tiny_SKsh   and   the   install  script  source)  are
  1049.      compressed.   This  was   necessary  so  that  the  SKsh017.lzh
  1050.      archive can be extracted onto an empty floppy.
  1051.  
  1052.  
  1053.        SKsh Amiga Shell            Page 16              Addendum to 1.7
  1054.  
  1055.  
  1056.  
  1057.