[net.sources] @#@#** YOUR SUBJECT HERE **#@#@

allbery@ncoast.UUCP (Brandon Allbery) (03/01/86)

Expires:

Quoted from <5041@alice.uUCp> ["Re: set work dir aliases (Any shell with aliases)"], by sgt@alice.UucP (Steve Tell)...
+---------------
| Here's a similar scheme that several people have been using on both
| csh and ksh:
| 
| csh:
| alias	d1	'set D1=`pwd`'
| alias	cd1	'cd $D1'
+---------------

When I do this it usually includes a major shift in context. I use the
following:

----------------
push
----------------
CSHTYPE="${2:-$CSHTYPE}"
export CSHTYPE
cd ${1:-.}
exec ${SHELL} -i
----------------------
alias pop	'unset prompt; exit'

Then, to switch contexts:

	[23] % push /appl/coesys COESYS
	[2,COESYS, 23] % pop
	[24] %

(My .cshrc checks environment variables CSHLEVEL and CSHTYPE, so I've got a
nesting level indicator and a current job.  Adding an alias if CSHTYPE is
non-null would be trivial.)  This costs processes -- but under Berkeley you
can ^Z etc. around (unfortunately, we're sys3).

Actually my ``push'' command is somewhat more involved than I show... it's
also on a different system.

--Brandon
-- 
In mid-winter, all of us Midwesterners would *love* a taste of California...
	(r-r-r-rumble) (SHA-A-KE!!!)		      ...but not *that* badly!

decvax!cwruecmp!ncoast!allbery  ncoast!allbery@Case.CSNET  ncoast!tdi2!brandon
(ncoast!tdi2!root for business)      6615 Center St. #A1-105, Mentor, OH 44060
Phone: +01 216 974 9210      CIS 74106,1032      MCI MAIL BALLBERY (part-time)