home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d8xx / d811 / bsh.lha / bsh / pop < prev    next >
Text File  |  1993-02-14  |  728b  |  29 lines

  1. # return to directory previously saved on the directory stack
  2. # (see also push).
  3. #
  4. # Pop is presented as is; no warrantee is either expressed or implied
  5. # as to it's suitability to any purpose whatsoever.  You assume all the
  6. # risk for all damage, even if caused by a defect in the software,
  7. # no matter how awful.
  8. if #argv != 1
  9.     echo usage: $0
  10. elseif !?Dir_stack
  11.     echo no Directory stack
  12. elseif Dir_stack<1
  13.     echo Directory stack empty
  14. elseif Dir_stack>size(Push_dirs)
  15.     echo Directory stack overflowed
  16. else
  17.     Dir_stack--
  18.     cd $Push_dirs[$Dir_stack]
  19.     Push_dirs[Dir_stack]=""
  20.     if Dir_stack==0
  21.     unset Dir_stack Push_dirs
  22.     if ?_debug
  23.         echo releasing Dir_stack
  24.     endif
  25.     endif
  26.     return 0
  27. endif
  28. return 10
  29.