home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
unix
/
volume7
/
dirstack.csh
/
restdir
< prev
next >
Wrap
Text File
|
1987-01-18
|
649b
|
27 lines
#! /bin/csh -f
#
# Shell script to restore directory stack (this file should be sourced)
#
# Author: Paul Lew, General Systems Group, Inc.
# Created at: 01/03/86
# Last update: 10/08/86 05:07 PM
#
if ( $?0 ) then
echo "...You should source this program, not execute it..."
goto end
endif
if ( ! ${?SAVED_WD} ) setenv SAVED_WD ~/saved_wd
if ( ! ${?filename} ) set filename = ${SAVED_WD}/cwd.wd
set _dirlist = `cat ${filename}`
set _dirs
foreach _dir (${_dirlist}) #reverse directory stack
set _dirs = (${_dir} ${_dirs})
end
chdir ${_dirs[1]}
shift _dirs
foreach _dir (${_dirs})
pushd ${_dir} > /dev/null
end
unset _dirlist _dir _dirs
end: