home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / os2 / pushd20.zip / PUSHD.DOC < prev    next >
Text File  |  1993-06-01  |  2KB  |  59 lines

  1. PUSHD version 2.0    June 1, 1993
  2.  
  3. This package contains REXX programs for changing directories.
  4. pushd, popd, and dirs are near-Unix (csh) equivalents.  "d" is
  5. a replacement for cd (I wish OS/2 would allow aliases, so that
  6. "cd" would call d.cmd.  I've heard that 4os2 has this behavior).
  7.  
  8. All the programs allow you to change drives as well as directories.
  9. You can use the forward slash, '/', as well as the backslash, '\'.
  10. The pushd,popd,dirs trio access a stack of directories as follows:
  11.  
  12. pushd pushes your current directory onto the stack and cd's to
  13. the new directory.  If there is no argument, pushd exchanges
  14. the top two entries of the stack (and cd's to the new top of
  15. stack).  The +n option allows you to rotate the stack to the
  16. nth entry (experiment to see how this works).  The top entry
  17. in the stack (your current directory) is the 0th entry.
  18.  
  19. popd pops off the top directory, and cd's to the new top of stack.
  20. The +n option will delete the nth entry from the stack, without
  21. changing directories.
  22.  
  23. dirs just shows you what the stack looks like.
  24.  
  25. Examples (C is FAT, D & E are HPFS):
  26.     [E:\] pushd /tmp
  27.     e:\tmp e:\
  28.  
  29.     [E:\tmp] pushd c:/dos
  30.     c:\DOS e:\tmp e:\
  31.  
  32.     [C:\DOS] pushd
  33.     e:\tmp c:\DOS e:\
  34.  
  35.     [E:\tmp] popd +1
  36.     e:\tmp e:\
  37.  
  38.     [E:\tmp] pushd d:\os2\mdos
  39.     d:\os2\mdos e:\tmp e:\
  40.  
  41.     [D:\os2\mdos] pushd
  42.     e:\tmp d:\os2\mdos e:\
  43.  
  44.     [E:\tmp] pushd +2
  45.     e:\ e:\tmp d:\os2\mdos
  46.  
  47.     [E:\] d apps
  48.  
  49.     [E:\apps] dirs
  50.     e:\apps e:\tmp d:\os2\mdos
  51.  
  52. An environment variable called PUSHD is used to save the
  53. directory stack.  This method allows you to maintain separate
  54. directory stacks in each window.  This is considered a *feature*,
  55. not a *bug*! :-).
  56.  
  57. Ken Neighbors
  58. wkn@leland.stanford.edu
  59.