WS - walk file system structure, executing commands.
Syntax:
ws [Pathname=]catalog ["command"]* [option]*
+Access +CHange
+CReate (+|-)CaTalogs (-)
(+|-)Files (+) (+|-)NonStructured (+)
(+|-)Privilege (-) (+|-)Query (-)
(+|-)ReLative (-) (+|-)ReMoveable (+)
(+|-)SUppress (-) (+|-)Stop (+)
(+|-)Verbose (-) Before=date
Levels=number (1) Mode=Linked|Random (both)
Pathname=catalog (current catalog)
PathnameChar=c (&) Since=date
Time=hh:mm
Examples:
ws
ws >filelist levels=10
ws /fred >fredfiles levels=1
ws "access mf &,delete" +verb pn=/me
ws "access mc &,modify/idallen/" "cata &*" +ct -stop
ws 'echo "% is there!"' 'time' pathc=%
ws "l & +type +file -content"
Options:
- "command"|'command'
- is the command string to be executed on each pathname
matched by WS. Several separate strings may be given to
WS. If not supplied, WS simply echoes the matched
pathnames.
- [Pathname=]catalog
- gives the starting catalog for the "walk". If
not supplied, this defaults to your current catalog. The
identifier "Pathname=" is optional.
- +Access
- uses the date of last access when selecting files by
date.
- Before=date
- only selects files with dates before "date".
- +CaTalogs
- performs the given command(s) on catalogs.
- -CaTalogs
- does not perform the command(s) on catalogs. You may not
specify both -CaTalogs and -Files.
- +CHange
- uses the date of last change when selecting files by
date.
- +CReate
- uses the date of creation when selecting files by date.
- +Files
- performs the given command(s) on files.
- -Files
- does not perform the command(s) on files. You may not
specify both -CaTalogs and -Files.
- Levels=number
- gives the depth to walk down while matching pathnames.
"number" defaults to 1, but may be set from 0
to 12. Values below or above this range get set to 0 or
12, respectively. Level=0 means WS does nothing.
- Mode=Linked
- selects only the linked (sequential) files under a
catalog.
- Mode=Random
- selects only the random files under a catalog.
- -NonStructured
- ignores "nonstructured removeable files" such
as catalogued tapes.
- PathnameChar=c
- replaces the character "c" by the current
pathname matched by WS whenever "c" is found in
a command string. "c" defaults to
"&", but may be set to anything.
- +Privilege
- lets a LODS user walk a catalog structure even if you do
not have execute permissions on the structure.
- +Query
- displays the current pathname and waits for input. If you
type "y", WS executes the command(s) on the
current pathname. If you type "x", WS
terminates. If you type anything else, WS does nothing
with this pathname and moves to the next. If you use
+Query with +Verbose, WS displays the whole expanded
command instead of just the pathname.
- +ReLative
- expands pathnames relative to the supplied pathname. In
other words, WS does not include the supplied pathname in
the generated names. You could use this for copying
catalogs where you only want the substructure paths.
(Note that WS normally expands pathnames relative to your
current catalog.)
- -ReMoveable
- ignores catalogs and files on structured removeable
devices.
- Since=date
- uses only files with dates after "date".
- -Stop
- does not stop if an executing program aborts or
terminates with an error. By default, WS quits if the
command(s) it is executing encounter an error.
- +SUppress
- suppresses a spurious "new-line" (line-feed)
before output. +SUppress can make prettier output when
you are using non-standard commands.
- Time=HH:MM
- may be used with +CHange. Use Since= or Before= to
specify a date, and Time= to specify a time on that date.
Time= can only be used with +CHange since FMS does not
keep time of day for creation or last access.
- +Verbose
- echoes each expanded command line as it is sent to the
system to be executed. If you use both +Verbose and
-Query, WS displays the whole set of expanded pathnames
before executing any command(s).
Description:
WS "walks" through a catalog structure, executing
one or more commands on each file and/or subcatalog in the
catalog. More precisely, WS executes the given TSS commands one
at a time, substituting the currently matched name in the given
catalog into each command. Options may be used to control the
depth to which WS walks the file system tree and to control
whether the TSS commands are to be executed for file names,
catalog names, or both. At sites where WS is installed as a
privileged command, you may walk any catalog where you have
execute permission. If WS is not installed as a privileged
command, you can only walk catalogs under CMDLIB, LIBRARY, and
your own userid.
If you do not specify any commands, WS simply displays the
pathnames in the catalog. You may redirect this output into a
file to get a list of files under a catalog.
WS checks for errors after each command. If an abort occurs in
one of the first command strings, WS won't execute any of the
remaining command strings unless you specify -Stop.
Copyright © 1996, Thinkage Ltd.