home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / UNIX / Shells / zsh-3.0.5-MIHS / src / Functions / pushd < prev    next >
Encoding:
Text File  |  1996-12-17  |  329 b   |  14 lines

  1. # pushd function to emulate the old zsh behaviour.  With this function
  2. # pushd +/-n just lifts the selected element to the top of the stack
  3. # instead of just cycling the stack.
  4.  
  5. emulate -R zsh
  6. setopt localoptions
  7.  
  8. if [[ ARGC -eq 1 && "$1" == [+-]<-> ]] then
  9.     setopt pushdignoredups
  10.     builtin pushd ~$1
  11. else
  12.     builtin pushd "$@"
  13. fi
  14.