home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
324.lha
/
Sweep
/
sweep.doc
< prev
next >
Wrap
Text File
|
1989-11-30
|
5KB
|
106 lines
SWEEP is a CLI program which takes CLI commands and executes them in the
current directory and in all directories below the current directory.
* The directory tree can be traversed in a pre-order (top down) fashion,
or in a post-order (bottom up) fashion. The latter is the default.
* Multiple commands can be issued in the same manner as with the RUN
command.
* Input and output can be redirected for SWEEP as well as for the
commands it executes.
The command syntax is:
SWEEP [+|-|?] cmd [+ <return> cmd] ...
+ As the first character, '+' forces the directory tree to be
traversed in a post-order (bottom up) fashion. This is the
default behavior, thus this parameter is useless. In this mode,
the command(s) will be executed in the lowest-level directories
first.
- forces the directory tree to be traversed in a pre-order (top down)
fashion. In this mode, the command(s) will be executed in the
current directory first, then in the lower-level subdirectories.
? Causes the command syntax to be displayed. In this case, any
command is ignored.
Some examples are in order.
Assume we have a disk with the following directory structure:
Volume Name: MyDisk
(root)
/ \
Test Real
/ \ / \
A Q S T
/ \
/ \
B F
/ | \ / \
C D E G H
SWEEP list Assuming our current directory is A, the list
command will be executed in the following
directories: C D E B G H F A
SWEEP -list Assuming our current directory is A, the list
command will be executed in the following
directories: A B C D E F G H
SWEEP s:spat protect #? -wed
This command would execute the spat script in all
the directories, making all the files and
directories read-only.
SWEEP delete #? With A as our current directory, this will delete
all the files in C, then in D, then E, then
go to B and delete all B's files, including
the now-empty directories C, D, and E. It
then cleans out G, H, F (getting rid of the empty
G and H directories there) and finally back
to A to delete A's files and the two empty
directories B and F. Use with care!
SWEEP -delete #? This command is just like the last one, but it
would not delete the directories that were
not empty from the start. This is because the
directory tree is traversed top-down. The delete
command in the A directory would remove all of A's
files, but because neither B nor F is empty, those
directories will remain. All the files in and below
A, however, would be deleted, just like the last
example.
SWEEP >ram:EditMe -echo "*N" +
cd +
list
Assume the F directory is our current directory.
This command would execute the echo, cd, and
list commands in each directory from the current
directory on down, in top-down fashon, producing a
file on RAM: called "EditMe" which could be printed
to provide a reference of what was on the disk.
It would look like this:
MyDisk:Test/A/F
.info 76 ----rwed 30-Oct-89 21:12:37
G Dir ----rwed 15-Jul-89 15:27:56
H Dir ----rwed 24-Oct-88 19:04:37
SomeFile 894 ----rwed 13-Aug-88 18:11:51
AnotherFile 370 ----rwed 13-Aug-88 18:11:55
SomeFile.info 894 ----rwed 13-Aug-88 18:12:05
6 files - 2 directories - 9 blocks used
MyDisk:Test/A/F/G
.info 16 ----rwed 24-Oct-88 19:48:47
1 file - 2 blocks used
MyDisk:Test/A/F/H
Directory "current directory" is empty