home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / utlos2.zip / Doc / cdx.doc < prev    next >
Text File  |  1997-10-24  |  4KB  |  83 lines

  1. $Id: cdx.doc 1.8 1997/10/25 01:51:50 brian Exp $
  2.  
  3.                       cdx.doc : The 'cdx' command
  4.                           By: Brian E. Yoder.
  5.  
  6.         (c) Copyright International Business Machines Corporation 1997
  7.         All rights reserved.
  8.  
  9. The cdx command is an enhanced (eXtended) version of the CD (or CHDIR)
  10. command. Like CD, it can go to a specified directory. Unlike CD, it can
  11. also change the current drive at the same time. It can go to a default
  12. HOME directory. And it can search through a set of paths for the
  13. specified directory, eliminating the need for a bunch of little command
  14. files to change directories.
  15.  
  16. The c:\tmp directory must exist and be writable for Win32 and OS/2. A
  17. temporary batch/command file is written to c:\tmp by the cdx command for
  18. these platforms.
  19.  
  20. For DOS, the cdx command is implemented as cdx.bat. The cdx.bat script
  21. calls cdir.exe and cdir.exe changes the current directory and drive
  22. itself.
  23.  
  24. For Win32, the cdx command is implemented as the cdx.bat script. For
  25. OS/2, it is implemented as the cdx.cmd script. For these platforms, cdx
  26. calls cdir.exe just to get the path and drive change information and
  27. then cdx itself performs the change. This is because these platforms,
  28. like Unix, don't allow a process to change its parent process's
  29. environment or working directory.
  30.  
  31. For DOS, the cdx.bat file just invokes the cdir.exe program. You can, if
  32. you wish, run the cdir.exe program directly to change your current
  33. working drive and path. Using cdx instead just lets your fingers type
  34. the same command on DOS, OS/2, and Win32.
  35.  
  36. This command cannot be named cd, which is a built-in DOS, Win32, and
  37. OS/2 command.
  38.  
  39. ========================================================================
  40. Command syntax
  41. ========================================================================
  42.  
  43.         cdx  [d:][path]                     -- On DOS, Win32, and OS/2
  44.  
  45. If both drive and path are missing, then cdx attempts to change the
  46. current drive and path to that specified by the HOME environment
  47. variable.
  48.  
  49. If the drive is present, then cdx changes your current drive to that
  50. drive. If the path is present, then cdx changes the current directory on
  51. that drive to the the specified 'path'.
  52.  
  53. If the drive is missing and the path is relative (doesn't begin with \),
  54. then cdx looks in the current directory for that path. If it doesn't
  55. find it, it then looks for the path in the directories specified by the
  56. CDPATH environment variable. The list of paths specified by CDPATH
  57. should be formatted just like those for the PATH environment variable.
  58.  
  59. ========================================================================
  60. Sample HOME and CDPATH settings
  61. ========================================================================
  62.  
  63. SET HOME=c:\u\brian
  64. SET CDPATH=c:\u\brian;c:\;d:\tools
  65.  
  66. ========================================================================
  67. Examples that use the sample settings shown above
  68. ========================================================================
  69.  
  70. cdx             Go to the 'c:\u\brian' (HOME) directory.
  71.  
  72. cdx a:          Go to the current directory on the A drive.
  73.  
  74. cdx d:\tmp      Go to the '\tmp' directory on the D drive.
  75.  
  76. cdx include     Go to the 'include' directory within the current
  77.                 directory. If it doesn't exist, then go to the first of
  78.                 the following directories that exist (see CDPATH):
  79.  
  80.                         c:\u\brian\include
  81.                         c:\include
  82.                         d:\tools\include
  83.