home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / pushpop.zip / POP.CMD < prev    next >
OS/2 REXX Batch file  |  1992-10-13  |  410b  |  22 lines

  1. /*   command to pop the last directory from the stack  */
  2. address CMD '@ECHO OFF'
  3. parse upper arg stk
  4. place = LASTPOS(';',stk)
  5. if place=0 then exit
  6. out = LEFT(stk, place-1)
  7. place = LASTPOS(';',out)
  8. if place=0 then
  9.   do
  10.   in  = out
  11.   out = ""
  12.   end
  13. else
  14.   do
  15.   in  = SUBSTR(out,place+1)
  16.   out = LEFT(stk, place)
  17.   end
  18. new = DIRECTORY(in)
  19. address CMD 'SET DIRSTK='out
  20. address CMD 'CD'
  21. exit
  22.