home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d1xx / d145 / csh.lha / Csh / POSTER < prev    next >
Text File  |  1988-05-26  |  4KB  |  112 lines

  1. Article 3827 of comp.sys.amiga:
  2. Path: fishpond!mcdsun!noao!ncar!ames!pasteur!agate!ig!uwmcsd1!tut.cis.ohio-state.edu!mailrus!umix!uunet!mcvax!enea!sics!jw
  3. From: jw@sics.se (Johan Widen)
  4. Newsgroups: comp.sys.amiga
  5. Subject: csh with file name completion (part 1 of 2)
  6. Message-ID: <1918@sics.se>
  7. Date: 30 Apr 88 21:55:07 GMT
  8. Reply-To: jw@sics.se (Johan Widen)
  9. Organization: Swedish Institute of Computer Science, Kista
  10. Lines: 904
  11.  
  12. This is part 1 of 2. Unpack by unsharing the two articles and then
  13.     cat shell.zoo.uu1 shell.zoo.uu2 >xxx
  14.     uudecode xxx
  15.  
  16. Here are a couple of nice improvements to csh 2.07M. The new features are:
  17.  
  18.     File name completion.
  19.     Assume that the following files are in the current directory:
  20.         foo.c bar.c bar.o adir
  21.     where adir is a directory. Enter the following partial command
  22.     line to csh
  23.         echo fo
  24.     then hit TAB (the cursor should be immediately after the string "fo").
  25.     csh should now expand this to
  26.         echo foo.c
  27.  
  28.     If you type
  29.         echo b
  30.     and then hit TAB, Csh will expand this to
  31.         echo bar.
  32.     Now try hitting CNTRL-D. Csh should now list
  33.         Directory of your-current-dir
  34.          bar.c bar.o
  35.  
  36.     If you type
  37.         echo ad
  38.     and then hit TAB, you should get
  39.         echo adir/
  40.  
  41.     File name completion is most useful on fast devices, like a ram disk.
  42.  
  43.     Now, as you noticed above csh would not expand b to bar.c because
  44.     there was a file bar.o in the directory. You can tell csh tha it
  45.     should ignore files with certain suffixes. This is done by setting
  46.     the shell variable 'fignore'.
  47.         set fignore .o
  48.     tells csh to ignore files ending in '.o'. 'b' will now expand to
  49.     'bar.c'.
  50.         set fignore .info,.o
  51.     will cause csh to ignore files ending in '.o' and '.info'.
  52.  
  53.     Note: the parsing done on the arguments before the completion is
  54.     very simple minded. The parser does not understand about spaces in
  55.     file names.
  56.     
  57.     Argument execution.
  58.     A string on the command line surrounded by grave accents will be
  59.     executed and the result of the execution will be substituted for
  60.     the the string.
  61.     
  62.     Example:
  63.         I have enclosed a command called sets (sets is the main reason
  64.         that I added the argument execution feature).
  65.         sets * -d *.zoo
  66.         will list all files except those that end with the suffix '.zoo'.
  67.             rm `sets * -d *.zoo`
  68.         will remove all files except those that end in '.zoo'. Neat, huh?
  69.  
  70.     The total size of the command line is currently limited to 256 bytes.
  71.     I consider this to be a very serious restriction.
  72.  
  73.     
  74. Time for some warnings and disclaimers.
  75.  
  76.     I have converted the csh back to Lattice. The source diffs that I have
  77.     provided are what you should need to put these facilities into csh under
  78.     MANX, but you may have to do some editing. I have not tried to compile
  79.     this under MANX but there should not be any serious problems.
  80.  
  81.     I can provide the complete diffs for Lattice if anyone is interested.
  82.  
  83.     The binary that I have provided is intended as a demonstration of how nice
  84.     these features are, to encourage you to put them into other shells,
  85.     including future csh's.
  86.  
  87.     The binary has been generated by the Lattice compiler. I have not done
  88.     a whole lot of testing on it so some bugs may remain. I have used ARP 1.1,
  89.     the binary will not work without it.
  90.  
  91.     A note about
  92.     run
  93.        The binary runs commands by calling SyncRun(). SyncRun() does not
  94.     handle run (the old AmigaDOS BCPL command). However, it does handle
  95.         arun
  96.     I usually copy arun to vd0:c/run.
  97.         copy sys:c/arun vd0:c/run
  98.  
  99.     Another caveat: redirection does not work together with run.
  100.  
  101.  
  102.                     Johan Widen
  103.                 USENET: jw@sics.se
  104.  
  105.  
  106. -- 
  107. Johan Widen
  108. SICS, PO Box 1263, S-164 28 KISTA, SWEDEN
  109. Tel: +46 8 752 15 32    Ttx: 812 61 54 SICS S    Fax: +46 8 751 72 30
  110. Internet: jw@sics.se or {mcvax,munnari,ukc,unido}!enea!sics.se!jw
  111.  
  112.