home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / pushd21.zip / pushd.doc < prev    next >
Text File  |  1993-09-22  |  2KB  |  65 lines

  1. PUSHD version 2.1    Sept. 22, 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. For directory names with embedded spaces, use quotes around it.
  11. The pushd,popd,dirs trio access a stack of directories as follows:
  12.  
  13. pushd pushes your current directory onto the stack and cd's to
  14. the new directory.  If there is no argument, pushd exchanges
  15. the top two entries of the stack (and cd's to the new top of
  16. stack).  The +n option allows you to rotate the stack to the
  17. nth entry (experiment to see how this works).  The top entry
  18. in the stack (your current directory) is the 0th entry.
  19.  
  20. popd pops off the top directory, and cds to the new top of stack.
  21. The +n option will delete the nth entry from the stack, without
  22. changing directories.
  23.  
  24. dirs just shows you what the stack looks like.
  25.  
  26. Examples (C is FAT, D & E are HPFS):
  27.     [E:\] pushd /tmp
  28.     e:\tmp e:\
  29.  
  30.     [E:\tmp] pushd c:/dos
  31.     c:\DOS e:\tmp e:\
  32.  
  33.     [C:\DOS] pushd
  34.     e:\tmp c:\DOS e:\
  35.  
  36.     [E:\tmp] popd +1
  37.     e:\tmp e:\
  38.  
  39.     [E:\tmp] pushd d:\os2\mdos
  40.     d:\os2\mdos e:\tmp e:\
  41.  
  42.     [D:\os2\mdos] pushd
  43.     e:\tmp d:\os2\mdos e:\
  44.  
  45.     [E:\tmp] pushd +2
  46.     e:\ e:\tmp d:\os2\mdos
  47.  
  48.     [E:\] d apps
  49.  
  50.     [E:\apps] dirs
  51.     e:\apps e:\tmp d:\os2\mdos
  52.  
  53. An environment variable called PUSHD is used to save the
  54. directory stack.  This method allows you to maintain separate
  55. directory stacks in each window.  This is considered a *feature*,
  56. not a *bug*! :-).
  57.  
  58. Ken Neighbors
  59. wkn@leland.stanford.edu
  60.  
  61. History:
  62. 1.0  pushd and popd written
  63. 2.0  added dirs, +n option, and comments
  64. 2.1  added support for directory names with embedded spaces
  65.