CSH script help needed

adamm%bbn-unix at sri-unix.UUCP adamm%bbn-unix at sri-unix.UUCP
Thu Jan 5 08:03:26 AEST 1984


From:  Adam Moskowitz <adamm at bbn-unix>

  Help !  I'm trying to make a command via some combination
of aliases and script files that will allow the following
scenario to take place :

  bbns /usr/adamm --> cd /usr/dir1/dir2/dir3
  bbns /usr/dir1/dir2/dir3 --> cat file1
  bbns /usr/dir1/dir2/dir3 --> wc file2
  bbns /usr/dir1/dir2/dir3 --> plugh /usr/adamm/dirA/dirB   # THIS ONE !
  bbns /usr/adamm/dirA/dirB --> vi fileX
  bbns /usr/adamm/dirA/dirB --> foo fileX
  bbns /usr/adamm/dirA/dirB --> plugh   # THIS ONE TOO !
  bbns /usr/dir1/dir2/dir3 -->

  where the --> and everything to the LEFT of it is the prompt.

  What I need is the stuff to do the 'plugh' command.  If I call it
with an arg, it should 'cd' to that place and remember where it came
from.  If I call it with no args, it should 'cd' me back to the last
place I 'plugh'd from (with an arg, of course).  The problem I've had
was that I couldn't find a way to get a shell script to leave me where
it 'cd'd to.  When I resorted to 'source'ing the script file, I couldn't
figure out how to pass args to the script.

  Please let me know if you have such a command or know how I can do this.
I'd be glad to re-distribute the results if/when I get them.

Thanx,
AdamM
(adamm at bbn-unix)



More information about the Comp.unix.wizards mailing list