Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!killer!pollux!dalsqnt!rpp386!pigs!haugj From: haugj@pigs.UUCP (John F. Haugh II) Newsgroups: comp.unix.questions Subject: Re: unsetenv TERMCAP in a csh Message-ID: <112@pigs.UUCP> Date: 10 May 88 19:28:39 GMT References: <479@cieunix.rpi.edu> <3780@csli.STANFORD.EDU> <622@amethyst.ma.arizona.edu> Organization: HECI Exploration, Dallas, TX Lines: 75 Summary: Here is a useful script, ... and a sample alias or two. In article <622@amethyst.ma.arizona.edu>, barsam@eros.ame.arizona.edu (Barsam Marasli) writes: > In article <3780@csli.STANFORD.EDU> gandalf@csli.stanford.edu (Juergen Wagner) writes: > [stuff deleted] > > ...and there is > >no way to change the parent's environment just by calling a script. > > > how about using "source" > ------------------------------------------------------------------------ > Barsam Marasli # Speak slowly, I hear with an accent. # here are a collection of csh scripts to do directory stacks which i hacked up one day in a fit of laziness. you need to extract this sharchive into some reasonable directory (~/bin in my case) and adjust the aliases to suit your taste. - john. ----------------------------- sharchive starts here ---------------------- #! /bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create: # popdir # pushdir # swapdir # This archive created: Tue May 10 14:24:08 1988 export PATH; PATH=/bin:/usr/bin:$PATH if test -f 'popdir' then echo shar: "will not over-write existing file 'popdir'" else cat << \SHAR_EOF > 'popdir' if ($#dirstack != 0) then cd $dirstack[1] shift dirstack endif echo '(' $dirstack ')' SHAR_EOF fi if test -f 'pushdir' then echo shar: "will not over-write existing file 'pushdir'" else cat << \SHAR_EOF > 'pushdir' set dirstack = (`pwd` $dirstack) echo '(' $dirstack ')' SHAR_EOF fi if test -f 'swapdir' then echo shar: "will not over-write existing file 'swapdir'" else cat << \SHAR_EOF > 'swapdir' if ($#dirstack >= 2) then set d1 = $dirstack[1] set d2 = $dirstack[2] shift dirstack shift dirstack set dirstack = ($d2 $d1 $dirstack) endif echo '(' $dirstack ')' SHAR_EOF fi exit 0 # End of shell archive --------- add these aliases to your .cshrc after fixing the directories ------- alias pushd 'source ~/bin/pushdir' alias popd 'source ~/bin/popdir' alias swapd 'source ~/bin/swapdir' -- The Beach Bum Big "D" Home for Wayward Hackers UUCP: ...!ihnp4!killer!rpp386!jfh jfh@rpp386.uucp :DOMAIN "You are in a twisty little maze of UUCP connections, all alike" -- fortune