home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 11 Util
/
11-Util.zip
/
utlos2.zip
/
Doc
/
cdx.doc
< prev
next >
Wrap
Text File
|
1997-10-24
|
4KB
|
83 lines
$Id: cdx.doc 1.8 1997/10/25 01:51:50 brian Exp $
cdx.doc : The 'cdx' command
By: Brian E. Yoder.
(c) Copyright International Business Machines Corporation 1997
All rights reserved.
The cdx command is an enhanced (eXtended) version of the CD (or CHDIR)
command. Like CD, it can go to a specified directory. Unlike CD, it can
also change the current drive at the same time. It can go to a default
HOME directory. And it can search through a set of paths for the
specified directory, eliminating the need for a bunch of little command
files to change directories.
The c:\tmp directory must exist and be writable for Win32 and OS/2. A
temporary batch/command file is written to c:\tmp by the cdx command for
these platforms.
For DOS, the cdx command is implemented as cdx.bat. The cdx.bat script
calls cdir.exe and cdir.exe changes the current directory and drive
itself.
For Win32, the cdx command is implemented as the cdx.bat script. For
OS/2, it is implemented as the cdx.cmd script. For these platforms, cdx
calls cdir.exe just to get the path and drive change information and
then cdx itself performs the change. This is because these platforms,
like Unix, don't allow a process to change its parent process's
environment or working directory.
For DOS, the cdx.bat file just invokes the cdir.exe program. You can, if
you wish, run the cdir.exe program directly to change your current
working drive and path. Using cdx instead just lets your fingers type
the same command on DOS, OS/2, and Win32.
This command cannot be named cd, which is a built-in DOS, Win32, and
OS/2 command.
========================================================================
Command syntax
========================================================================
cdx [d:][path] -- On DOS, Win32, and OS/2
If both drive and path are missing, then cdx attempts to change the
current drive and path to that specified by the HOME environment
variable.
If the drive is present, then cdx changes your current drive to that
drive. If the path is present, then cdx changes the current directory on
that drive to the the specified 'path'.
If the drive is missing and the path is relative (doesn't begin with \),
then cdx looks in the current directory for that path. If it doesn't
find it, it then looks for the path in the directories specified by the
CDPATH environment variable. The list of paths specified by CDPATH
should be formatted just like those for the PATH environment variable.
========================================================================
Sample HOME and CDPATH settings
========================================================================
SET HOME=c:\u\brian
SET CDPATH=c:\u\brian;c:\;d:\tools
========================================================================
Examples that use the sample settings shown above
========================================================================
cdx Go to the 'c:\u\brian' (HOME) directory.
cdx a: Go to the current directory on the A drive.
cdx d:\tmp Go to the '\tmp' directory on the D drive.
cdx include Go to the 'include' directory within the current
directory. If it doesn't exist, then go to the first of
the following directories that exist (see CDPATH):
c:\u\brian\include
c:\include
d:\tools\include