Ben Horowitz wrote: > Hi, > > I love bash, and I've been using it for a number of years. Recently, > I worked with software engineers who used tcsh primarily, where I grew > to appreciate one feature of tcsh: the ability to use the commands > pushd -v, and popd -v. > > As you know, when the bash pushd and popd commands are successful, > they print the directory stack. In tcsh, one can additionally issue > the command pushd -v, which is like the bash commands pushd followed > by dirs -v. This feature appears not to be available in bash. > > tcsh> pushd -v /tmp > 0 /tmp > 1 / > > I find this to be a good feature of tcsh because I find that the > output of dirs without the -v argument can get cluttered, especially > when there are many directories on the stack.
Here's a first cut. Salt to taste (yes, you should use getopts): pushd() { local es case "$1" in -v) vflag=y; shift ;; esac builtin pushd "$@" es=$? [ -n "$vflag" ] && dirs -v return $es } -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ( ``Discere est Dolere'' -- chet ) Live...Laugh...Love Chet Ramey, ITS, CWRU [EMAIL PROTECTED] http://cnswww.cns.cwru.edu/~chet/ _______________________________________________ Bug-bash mailing list Bug-bash@gnu.org http://lists.gnu.org/mailman/listinfo/bug-bash