Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!decvax!harpo!seismo!hao!hplabs!sri-unix!adamm@bbn-unix From: adamm%bbn-unix@sri-unix.UUCP Newsgroups: net.unix-wizards Subject: CSH script help needed Message-ID: <15094@sri-arpa.UUCP> Date: Wed, 4-Jan-84 17:03:26 EST Article-I.D.: sri-arpa.15094 Posted: Wed Jan 4 17:03:26 1984 Date-Received: Sat, 7-Jan-84 02:13:50 EST Lines: 31 From: Adam Moskowitz 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@bbn-unix)