home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 18 REXX
/
18-REXX.zip
/
rexxlb.zip
/
SAMPLES
/
COPYEX.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1993-01-09
|
2KB
|
49 lines
/*****************************************************************************/
/* */
/* COPYEX: copy a group of files except for specified extensions. The */
/* extensions to be excluded are read from the keyboard. */
/* */
/* Requires Personal REXX or REXXLIB (dosdir, parsefn, dosdrive, doscd */
/* dosisdir, parsefn, upper functions). */
/* */
/* Command format: COPYEX <from> <to> */
/* */
/*****************************************************************************/
signal on novalue
parse arg from to .
if to = '' then do
say "Format: COPYEX <from> <to>"
exit 1
end
if dosdir(from) = '' then do
say "No files found matching '"from"'."
exit 2
end
/* read excluded extensions */
say "Enter excluded extensions, one per line, ending with null line:"
extension. = ''
do forever
pull ext .
if ext = '' then
leave
extension.ext = '1'
end
/* go through list of files */
parse value parsefn(from) with drive path fn ft
if drive = '-' then
drive = dosdrive()
if path = '-' then
path = doscd(drive)
if right(path,1) \= '\' then
path = path'\'
file = dosdir(from,'n')
do while file \= ''
parse upper value parsefn(file) with . . . ft1
if extension.ft1 \= '1' then
'copy' drive':'path||file to
file = dosdir(,'n')
end