unsetenv TERMCAP in a csh

John F. Haugh II haugj at pigs.UUCP
Wed May 11 05:28:39 AEST 1988


In article <622 at amethyst.ma.arizona.edu>, barsam at eros.ame.arizona.edu (Barsam Marasli) writes:
> In article <3780 at csli.STANFORD.EDU> gandalf at 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 at rpp386.uucp :DOMAIN

 "You are in a twisty little maze of UUCP connections, all alike" -- fortune



More information about the Comp.unix.questions mailing list