The Mass Storage System (MSS) commands include powerful file-selection techniques, namely, wild
card characters and the msfind command. These techniques often allow you
to conveniently perform operations on multiple MSS files.
However, sometimes you may wish to perform operations on multiple MSS files
that can't be readily selected with wildcards or with msfind. This is
where the "list" method may come in handy.
In the "list" method, you prepare a list of the MSS files you want to process
and put this list in a file on your local computer. Then you can pass this
list on to many of the available MSS commands.
The MSS commands that will work with this "list" method are:
| msallinfo |
mschproj |
mscomment |
| msls |
mspasswd |
msrawinfo |
| msrecover |
msretention |
msrm |
| msstage |
mstouch |
What makes the "list" method practical is use of the Unix command xargs.
This command will read your file and pass the filenames along to the specified
MSS command. xargs will actually break up the list of files into manageable
chunks so that it does not exceed your shell's command line limit; hence the
desired MSS command may actually be run several times, each with a different
chunk of the filenames. The xargs command has several options, including the -t
option that allows you to see the full command it's executing.
Let's create a file called ms.filelist that contains the names of
several MSS files that we are interested in:
my/file/one
some/other/file and/another
/PAT/yet/another/file
ocean/1998*
last.file
Since there is no obvious pattern to the filenames, we can't make use of
wildcards to select them. And there are enough files here that we probably
wouldn't want to type them all in as arguments to an MSS command.
We can do an msls -l on these files using xargs, like this:
xargs msls -l < ms.filelist
or, if you prefer, with the equivalent command:
cat ms.filelist | xargs msls -l
If we want to see the actual command line that xargs is running, we can
add the -t option to xargs:
xargs -t msls -l < ms.filelist