home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / utility / cli / sksh017.lzh / doc / Hints.doc < prev    next >
Encoding:
Text File  |  1991-05-04  |  6.1 KB  |  331 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.                           Hints and Tips for
  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.        Making SKsh Resident
  74.  
  75.      SKsh  version 1.1 or later can be made resident.   Add  a  line
  76.      like this to your startup-sequence:
  77.  
  78.         c:resident sksh
  79.  
  80.      where 'sksh' is the path  to  the  sksh  command itself.  Then,
  81.      when SKsh is run  through  a  shell-window,  the  resident SKsh
  82.      will be used, not the disk-based SKsh.
  83.  
  84.  
  85.        Starting SKsh with 'newcli' or 'newshell'
  86.  
  87.      The  'newcli'  or  'newshell' commands can be made to automati-
  88.      cally start SKsh when  a  new  CLI  window is generated.  There
  89.      are two things that need to be done for  this.   First,  define
  90.      an alias like this:
  91.  
  92.       alias newcli='$(which newshell) CON:0/0/640/200/SKsh_Window'
  93.  
  94.      Also, you  must  create a s:Shell-Startup file which runs SKsh.
  95.      Mine looks like this:
  96.  
  97.         setfont source 10 window
  98.         sksh -S
  99.  
  100.      You may have to change this if you do not  have  the  'setfont'
  101.      command or do not  have  it  installed in 'sys:bin'.  The 'new-
  102.      cli'  command will now start up  a  new  window, with the given
  103.      size, and run  SKsh  for  you  automatically using the resident
  104.      'SKsh'.  To make the 'exit'  command in SKsh destroy the window
  105.      when SKsh exits, put the following in your .skshrc file:
  106.  
  107.         LOGOUT='endcli'
  108.  
  109.      Now,  the  'newcli' alias can be used  transparently with SKsh.
  110.      A  similar mechanism can be used with MachII or other utilities
  111.      which  let  you  define a  hotkey which will create a new shell
  112.      window.  Simply replace "newcli" with:
  113.  
  114.        c:newshell CON:0/0/600/180/SKsh_Window
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.        SKsh Amiga Shell             Page 2               Hints and Tips
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.        Forcing execution as a program
  144.  
  145.      The  'force'  keyword will only  force  execution as a builtin,
  146.      alias, or  function.   To  force  execution as an external pro-
  147.      gram, simply use:
  148.  
  149.         $(which prog) args
  150.  
  151.  
  152.        Re-sourcing the .skshinit file
  153.  
  154.      If you source the .skshinit file  after you start SKsh, any op-
  155.      tions you have set in your  .skshrc  file  will  potentially be
  156.      overridden.   One   example of this is  the  'e'  option.   The
  157.      .skshinit file sets  it,  which  disables command line editing.
  158.      It  is  reset in the .skshrc file.  If you source the .skshinit
  159.      file again  without sourcing the .skshrc file, you will have to
  160.      reset this option flag manually.
  161.  
  162.  
  163.        Using ^r for reverse searches
  164.  
  165.      The  SKsh  usage of ^r  for  reverse searches is different than
  166.      the ksh usage.  In ksh, you type ^r, which is  echoed, the text
  167.      you wish to search for, and then return.   In  SKsh,  you  type
  168.      the text you wish to search for,  followed by ^r.  I have found
  169.      this usage more convienent.
  170.  
  171.  
  172.        Changing default command options
  173.  
  174.      To  change  the  default  command options for a particular com-
  175.      mand,  define an alias of the same name which uses the  'force'
  176.      keyword.   For   example, to change the 'rm' command so that it
  177.      echoes file names as they are  deleted, put the following alias
  178.      in your .skshrc file:
  179.  
  180.        alias rm = 'force -b rm -v'
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.        SKsh Amiga Shell             Page 3               Hints and Tips
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.        File name completion hints
  206.  
  207.      The  <esc>=  command can be used to list all file  names  in  a
  208.      given directory.  If the  previous word ends in a slash, <esc>=
  209.      will list each file in the directory:
  210.  
  211.        [dh0:]: more ram:test/
  212.      (press <esc>=)
  213.        1) ram:test/file1.txt
  214.        2) ram:test/file2.txt
  215.        3) ram:test/my_file.txt
  216.  
  217.  
  218.        Maximum command line length
  219.  
  220.      Command lines  which  are  passed  to  external  functions  are
  221.      limited  in  length  by  AmigaDos  to  255  characters.   Alias
  222.      substitions are limited in length by SKsh to  1023  characters;
  223.      lines longer than that will generate a syntax error.   However,
  224.      SKsh  builtins  can  operate  on  any  number   of   arguments.
  225.      Therefore, a "dir foo:*" might generate a  syntax  error  if  a
  226.      very large number of files are matched.  In these cases  (which
  227.      should be rare) the builtin form of the alias  (in  this  case,
  228.      "ls")  will  operate  correctly  since  there  are  no   length
  229.      limitations.
  230.  
  231.      You  can  circumvent  the  external  command length  limitation
  232.      through the use of the xargs command.
  233.  
  234.  
  235.        Bypassing Internal Commands
  236.  
  237.      If a name is interpreted  by  SKsh  as  a  builtin,  alias,  or
  238.      function, but is also an external command,  starting  the  name
  239.      with a capital letter will  force  SKsh  to  use  the  external
  240.      command.  SKsh internal  commands  are  case  sensitive,  while
  241.      external binaries are not.  For example,  using  a  lower  case
  242.      "dir" normally invokes the SKsh alias of that  name.   However,
  243.      using "Dir" will invoke the AmigaDos command provided  that  it
  244.      is in your search path.  The builtin form of  the  command  can
  245.      also be unaliased or unset.
  246.  
  247.  
  248.        Making Commands Resident
  249.  
  250.      There  are  several different resident command standards avail-
  251.      able  under AmigaDos.  SKsh uses the ARP method, and will "see"
  252.      resident  commands added to that list (which the SKsh  resident
  253.      command will  do).   If  commands are added to another resident
  254.      list, SKsh will use the disk based form of the command.
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.        SKsh Amiga Shell             Page 4               Hints and Tips
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.        Using the mplist command
  272.  
  273.      The mplist is  simply a generic mechanism for mapping any argu-
  274.      ment to any other string.  For  example, you may wish to abbre-
  275.      viate the name of a directory so that instead of typing:
  276.  
  277.         cd sys:usr/commands/src/cmd1/directory-one
  278.  
  279.      you can type:
  280.  
  281.         cd d1
  282.  
  283.      To do that, add the following line to your .skshrc file:
  284.  
  285.           mplist -a 'd1=sys:usr/commands/src/cmd1/directory-one'
  286.  
  287.      Any  reference to the unquoted string d1 will be  replaced with
  288.      the directory name.
  289.  
  290.      The  destination string does not have to be  a  directory name.
  291.      It can be any string.
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.        SKsh Amiga Shell             Page 5               Hints and Tips
  328.  
  329.  
  330.  
  331.