home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Professional
/
OS2PRO194.ISO
/
os2
/
sysutils
/
ho2
/
ho.doc
next >
Wrap
Text File
|
1994-02-12
|
3KB
|
84 lines
HO for OS/2 by Walt Howard Version 1.0 Feb 12 1994
Do X to all files fitting specification Y.
Copyright (c) 1994 by Walter F. Howard, All Rights Reserved
Ho will perform a command line on every file that matches a spec. You
give it a command line using normal characters and some special ones
that get replaced during execution. The command line is what you
want done on each of the files. This command line MUST be enclosed in
quotes
USAGE: ho "command" <options>
Where "command" is the command line in which any of the following
variables will expand out when executed:
Variable Description Expands to
------------------------------------------------------------------------
@n file name COMMAND.COM
@f full path spec C:\OS2\MDOS\COMMAND.COM
@d directory only \OS2\MDOS
@h drive letter C
@r file root (no extension) COMMAND
@e file extension COM
OPTIONS:
p=<file pattern> multiple allowed, if no p=, file names will be taken
from standard input
D=<directory to work on> defaults to current directory. Any option
starting with a \ or a drive specifier (C:) will also be understood
as the directory to start the work in
+s do subdirectories also
+q ask before each command is executed
+c change directories when doing subdirectories
+d only do DIRECTORY names
a=<attributes> ARSH (Archive, Read Only, System, Hidden)
a!<not attributes> ARSH
a$<any of these attributes> ARSH
MORE OPTIONS:
You can select by dates and sizes also using the following symbols:
Symbol Meaning Example
--------------------------------------------------------------------------
d last write date d}2/1/93 write dated on or after 2/1/93
l last access date l{7/15/94 last accessed before 7/15/94
c created date c=12/16/86 created on 12/16/86
s size s}300000 size greater than 300000 bytes
= equal to or on the date l=10/13/90
} greater than or equal c}7/9/87
{ less than or equal to s{5
Note: Curly Braces are used rather than the obvious ">" and "<" because
those would tell the command interpreter to redirect input or output.
Multiple commands can be executed by separating them with a semi-colon (;).
There some additional advanced variables you can put in the command line.
Variable Description Expands to
------------------------------------------------------------------------
@u uppercase file name COMMAND.COM
@l lowercase file name command.com
@'prompt' prompt user special - asks user question
EXAMPLES:
ho "copy @f b:" D=\os2 p=*.exe d}2/20/93
copy all *.exe files in the \os2 directory, dated after or on 2/20/93 to b:
ho "ren @f @'new file name'" p=*
go through each file in the directory and ask the user for a new name
ho "del @n" d=12-12-92 +q <filelist.txt
delete all files whose names are in the file filelist.txt and dated 12-12-92
The +q would also cause the user to be asked yes or no to each deletion
ho "copy @n b:\old\@n; del @n" p=* s}300000 a=r
copy all files sized 300000 or over with ro attribute to b:\old then delete
walth@netcom.com