Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!cs.utexas.edu!bryan From: bryan@cs.utexas.edu (Bryan Bayerdorffer) Newsgroups: comp.sys.amiga Subject: Re: Enviroment (was Re: Yea, but can an Amiga Shell do this.... Message-ID: <3275@cs.utexas.edu> Date: 3 Sep 88 22:16:56 GMT References: <8808232121.AA28517@cory.Berkeley.EDU> <8637@cup.portal.com> <4653@cbmvax.UUCP> <21291@tut.cis.ohio-state.edu> Sender: news@cs.utexas.edu Reply-To: bryan@cs.utexas.edu Organization: Spam Detection & Removal Squad, Austin, TX Lines: 35 Spam-Content: Negligible In article <21291@tut.cis.ohio-state.edu> stellrec@deneb.cis.ohio-state.edu (barry stellrecht) writes: =-A way which supports multi-tasking much better, if you are using the Dillon/ =-Drew CSH program would involve the two aliases below (I use them fairly =-extensively myself): =- =-alias savecd "cd | input _oldcd" =-alias oldcd "cd $_oldcd;unset oldcd" =- It's faster and more elegant to use an alias with argument substitution than to use a pipe. I.e. alias savecd "%z cd $z; set _oldcd $z" In any case, the following is a much more general solution. I don't remember who first came up with this, but it wasn't me: # push and pop directories alias pop "strhead _cwd ~ $popdir ; strtail popdir ~ $popdir ; cd >NIL: $_cwd ;$alias push "%q set popdir $_cwd~$popdir ; cd $q" Nice, huh? Other shell quirkinesses (or, I call 'em bugs, you call 'em features): strhead b \ $a #will correctly break $a at a space, but... strhead b \ $a #will not. The 'input' command does not abort at an end-of-file (^\). ______________________________________________________________________________ /_____/_____/_____/_____/_____/_____/_____/_____/_____/_____/_____/_____/_____/ |_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____| _No dark sarcasm in the classroom|_____|_____|_____|_____|_____|_____|_____|___ |____Teachers leave the kids alone__|_____|_____|_____|_bryan@cs.utexas.edu___| ___|_____|_____|_____|_____|_____|_____|{ihnp4,seismo,...}!cs.utexas.edu!bryan_ |_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|