home *** CD-ROM | disk | FTP | other *** search
- ═════════════════════════════════════════════════════════════════════
- XT 2.3 [May 19 1992] Copyright (c) 1991, 1992 by Paul Whittemore
- ═════════════════════════════════════════════════════════════════════
-
- Summary
- ═══════
- See the license agreement at the end of this document before using
- this program. Don't worry, it's as liberal as they get.
-
- What is XT? A lot of people demanded this one. It is perhaps the
- single most important utility I have except for my text editor. It
- has a single general goal, but in accomplishing this goal, the
- program becomes a multi-purpose utility. XT's goal is to provide a
- general way of traversing a DOS directory structure performing some
- (usually external) operation on a subset of the files found. In many
- ways it resembles earlier SWEEP utilities, but is perhaps better.
- Much user feedback has been applied since it's first incarnation and
- improvements continue to be made to the program.
-
- WARNING: This command is very powerful. With power comes
- responsibility. If you are unsure of a command, do NOT use XT or use
- the -n option to test it first. The author is not responsible for
- any loss due to the use of this program.
-
-
- Syntax
- ══════
-
- This is perhaps the most difficult aspect of LS. Although completely
- consistent, many people find the command line very confusing. The
- syntax is:
-
- XT [<options> [<filespec> [<command-template>] ] ]
-
- Before we get to the actual options, an explanation is in order.
-
- XT will traverse a given directory tree applying a command for every
- match. XT without a command template will simply list all matches.
- If no filespec (pattern) is specified, "*.*" is assumed. The
- <command-template> field can be as long as DOS will allow the line
- and can specify any command including batch (.BAT) files.
-
- Some examples:
-
- XT readme.doc
- - displays the name of all README.DOC files in and under the
- current directory.
-
- XT
- - displays the names of all files in and under the current directory.
-
- XT *.com
- - displays the names of all files whose filename extension is '.COM'.
-
- XT readme.doc type readme.doc
- - displays the CONTENTS of all README.DOC files in and under the
- current directory (by executing the DOS TYPE command).
-
- In the last example, "type readme.doc" is the <command-template> part
- of the command line. Rather than retyping the name of the file
- (readme.doc), XT has special placeholders which begin with a dollar
- sign ($). For example, $n represents the name (root + ext) of the
- file. Thus, the previous command could have been abreviated to the
- following:
- XT readme.doc type $n
-
- Template Escape Codes
- ═════════════════════
- The following command template escape codes (placeholders) may occur
- as many times as desirable in the <command-template> part of the
- command line:
- $f the full path name of the matching file
- $p the directory part of the matching filename
- $d the relative directory part of the matching filename
- $n the filename & ext of the matching file
- $r the root file name of the matching file
- $e the extension name of the matching file
-
- Another example: Assume your current directory is C:\TOPLEVEL and
- you execute the following command:
-
- XT *.doc
-
- Let's say XT displays the following files:
-
- 1. C:\TOPLEVEL\README.DOC
- 2. C:\TOPLEVEL\PERSONAL\RESUME.DOC
- 3. C:\TOPLEVEL\SUBDIR1\README.DOC
- 4. C:\TOPLEVEL\UTILITY\XT\XT.DOC
- 5. C:\TOPLEVEL\UTILITY\LS304\LS.DOC
- (The numbers are for reference below.)
-
- The paths above represent the value of $f for each match. The value
- of $p is constant for each execution of XT, in this case it will have
- a value of "C:\TOPLEVEL\". The quotes are for readability in this
- document only. Note the trailing slash. The values of the $d are
- listed below:
-
- Match $d
- ----- ----------------
- 1 ""
- 2 "PERSONAL\"
- 3 "SUBDIR1\"
- 4 "UTILITY\XT\"
- 5 "UTILITY\LS304\"
-
- In the examples above, $n is always "README.DOC", $r is always
- "README", and $e is always ".DOC". The value of $f is always the
- concatenation of $p$d$n or $p$d$r$e.
-
-
- Options
- ═══════
- The following options can be specified before the <filespec> pattern
- (if present):
-
- -h, -? displays this usage help
- -r non-recursive (do NOT scan subdirectories)
- -c change to directory of match before running command
- -d match directory names only
- -q enables quiet mode (no command echo)
- -n do not execute commands (echo only)
- -p patterned list of directories only
- (-p assumes -nq, just lists files as in template)
-
- The -p option is useful in creating batch files. For example, the
- command "XT -p *.doc copy $f d:\docs >copydocs.bat" might produce a
- file COPYDOCS.BAT containing:
- copy C:\TOPLEVEL\README.DOC d:\docs
- copy C:\TOPLEVEL\PERSONAL\RESUME.DOC d:\docs
- copy C:\TOPLEVEL\SUBDIR1\README.DOC d:\docs
- copy C:\TOPLEVEL\UTILITY\XT\XT.DOC d:\docs
- copy C:\TOPLEVEL\UTILITY\LS304\LS.DOC d:\docs
-
- If any of the following are specified, it is an explicit list of
- the include set (the directory entries to match):
- +r include read-only files
- +w include read-write files
- +h include hidden files
- +s include system files
-
- For example, "XT +r" lists all read-only file in and under the
- current directory.
-
-
- A Word About The -d Option
- ══════════════════════════
- The -d option applies the pattern specified by <filespec> to
- directory entries rather than regular files. The matching directory
- entry can be referenced by the $n and $f escape codes, just like it
- is for matching files. This can be confusing but is, at least,
- consistent. (This may change in the future, but is not a planned
- change at this time.)
-
- To list all directories starting with 'T', the following command
- would be used: xt -d t*.*
-
- To remove all such directories, use one of the following:
- xt -d t*.* rd $f
- xt -d t*.* rd $d$n
- or, if your a 'real' geek,
- xt -d t*.* rd $p$d$r$e
- xt -d t*.* rd $p$d$n
-
- Note that the point here is that $d is NOT sufficient. When using
- the -d option, $d is the relative name of the *parent* of the matching
- directory, rather than the directory itself.
-
-
- Recent Revisions
- ════════════════
-
- Version 2.3:
- -----------
- Added -c option. When specified, XT will change the current
- directory and drive, if necessary, to the directory part of any
- matches found. For directories matched via -d, this includes the
- whole directory ($f), not everything except the last component ($p$d).
-
- XT will now always save the current directory on the current drive
- (only) and will restore it on normal or CTRL-BREAK termination.
-
-
- Version 2.2:
- -----------
- Added attribute patterns (+r +w +h +s). Recommend +r and +w use
- only, since +h and +s may not achieve desired results. Try XT with
- the -n option to verify expectations.
-
- Options may be combined (e.g. +rh).
-
-
- Version 2.1:
- -----------
- A lot of people have been pushing for improvements in my XTREE program,
- so over the weekend I upgraded it to use my PATHS library... This combined
- with some other work results in several improvements:
-
- - You can now specify absolute or relative paths in front of the pattern.
- - The command template filter/escape sequences have been revised to
- allow the inclusion of the relative part of a matching path name ($d).
- - The program now aborts cleanly on a Ctrl-Break signal.
- - You can specify (-d) that the pattern should be used to match
- *directory* names.
- - The program is now recursive by default.
-
- Due to the incompatable changes to both the escape filtering and the defaults,
- combined with the fact that there is a commercial program named XTREE, I have
- decided to rename the executable to XT.EXE.
-
- More Examples:
- ══════════════
-
- XT ? or XT -? or XT -h
- Gives help, the command syntax and options.
-
- XT *.c
- Like WHEREIS. Displays all .C files under the current directory.
-
- XT \*.c
- Like WHEREIS. Displays all .C files anywhere on the current drive.
-
- XT -d C:\X*.*
- WHEREIS for directories. Finds all directories on drive C: that
- start with an X.
-
- XT -d c:*.* md d:$d
- Copies the directory structure existing under the current directory
- on drive C: to the current directory on drive D:. Note that $d is
- the *relative* directory name, needed in this case.
-
- XT c:*.c copy c:$f d:$d$n
- Recursively copies all .C files existing under the current directory
- on drive C: to the corresponding current directory on drive D:. Note
- that $d is the *relative* directory name, and that the full path of
- the matching (source) file is $f.
-
-
- License Agreement
- ═════════════════
- Use of this program is ALMOST completely without restriction. Stupid
- little command-line utilities which aid the user in some small manner
- should not be restricted since a better working enviroment helps us
- all and may even lower the cost of more significant programs.
-
- This program may NOT be sold or exchanged for any other consideration
- without express written consent of the author. Where bundled as part
- of a larger collection of programs, this program may be included in
- cases where it does not represent a significant portion (greater than
- ten (10) percent) of the functionality of the product being sold. It
- may be included in sales of public domain software disks provided the
- charge for such services does not exceed five dollars ($5) U.S. for
- the disk containing this program. (I know that's less than some
- folks charge, but come on guys, twice the cost of the disk for
- something somebody else gave you for free should be enough!)
-
- Other than this single restriction, this program may be used,
- distributed and/or included with other products provided both the
- program and this document file are included unchanged. This means
- that you can use it at home or at work, company software and LAN
- administrators can distribute to it to fellow employees without
- reservation and you can even provide it as a bonus with your own
- termination emulation, email or other fine product).
-
- Due to the nature of this program, the author wishes to make it clear
- that the use of this utility is subject to the discretion of the user
- and that no implied warrantee exists. The author will accept no
- responsibility for its use. There are no intentionally destructive
- 'features', however commands like "XT *.* del $f" could have serious
- impact on the user's blood pressure (not to mention the hard disk).
-
- The author can be contacted at the following addresses:
-
- Paul Whittemore
- 853 Grenoble Blvd.
- Pickering, Ontario
- Canada L1W 1T7
-
- CompuServe: 72007,3305
- Internet: pwhittem@novell.com
- MHS: pwhittem@novell
-
-