]>
cvs.zerfleddert.de Git - micropolis/blob - src/tclx/tclsrc/pushd.tcl
4 # C-shell style directory stack procs.
6 #------------------------------------------------------------------------------
7 # Copyright 1992 Karl Lehenbauer and Mark Diekhans.
9 # Permission to use, copy, modify, and distribute this software and its
10 # documentation for any purpose and without fee is hereby granted, provided
11 # that the above copyright notice appear in all copies. Karl Lehenbauer and
12 # Mark Diekhans make no representations about the suitability of this
13 # software for any purpose. It is provided "as is" without express or
15 #------------------------------------------------------------------------------
16 # $Id: pushd.tcl,v 2.0 1992/10/16 04:52:06 markd Rel $
17 #------------------------------------------------------------------------------
20 #@package: TclX-directory_stack pushd popd dirs
22 global TCLENV
(dirPushList
)
24 set TCLENV
(dirPushList
) ""
29 if {[llength $args] > 1} {
30 error "bad # args: pushd [dir_to_cd_to]"
32 set TCLENV
(dirPushList
) [linsert $TCLENV(dirPushList
) 0 [pwd]]
34 if {[llength $args] != 0} {
42 if [llength $TCLENV(dirPushList
)] {
43 cd [lvarpop TCLENV
(dirPushList
)]
46 error "directory stack empty"
52 echo
[pwd] $TCLENV(dirPushList
)