POSIX Shell Pattern Support

Unless otherwise noted, the DCS commands that accept MSS file pathnames as input operands will accept POSIX-style shell patterns for expansion (also known as shell wildcards, as described briefly below and in POSIX section 3.13).

Note

These patterns used to generate MSS file names must be quoted on the command line to prevent interpretation by the user's local shell. For example:
msls '*.tar.gz'
However for msrcp, do not quote shell patterns that refer to files on the user's local system. Only the patterns referring to pathnames on the MSS (i.e. those prefixed with mss:) need be quoted.

A pattern consists of normal characters, which match themselves, and metacharacters. The metacharacters are !, *, ?, and [. These characters lose their special meanings if they are quoted by preceeding them with a back slash (\). An asterisk (*) matches any string of characters. A question mark (?) matches any single character. A left bracket ([) introduces a character class. The end of the character class is indicated by a right bracket (]); if the ] is missing then the [ matches the [ character itself, rather than introducing a character class. A character class matches any of the characters between the square brackets. A range of characters may be specified using a minus sign (-). The character class may be complemented by making an exclamation point (!) the first character of the character class. To include a ] in a character class, make it the first character listed (after the !, if any). To include a minus sign, make it the first or last character listed.

Csh-style brace patterns like {pat1,pat2,...} will also be expanded. Csh-style tilde expansion (~user or ~/) is also done.

In the following table, each type of wildcard is marked with a notation about its relative expansion speed. Those wildcards marked as "Slow" will have to read the entire directory contents to determine all matching file names. This could be slow if the directory has more than a few hundred files, or very slow for directories with more than a thousand files. See the section called “Metadata Guidelines” for more wildcard usage guidelines.

Table 2.1. Shell Pattern (Wildcard) Summary

Pattern Expansion Speed Description Example Meaning
* Slow Matches 0 or more characters 'ocean/199*' Match all names in the ocean subdirectory that start with '199'.
? Slow Match a single character 'ocean/199?/data' Matches all subdirectories of the subdirectory ocean that have four character names that start with '199'. Then selects any name data within those matched directories.
[] Slow Match a class of characters 'ocean[bpt]' Matches all names of the forms oceanb, oceanp, and oceant.
Use - for a range of characters 'ocean[a-z]' Matches all names that start with ocean followed by a lower case letter.
Use ! as the first character for negation. 'ocean[!w-z]' Matches all names that start with ocean followed by a character that is not one of 'w', 'x', 'y' or 'z'.
{} Fast Match multiple patterns 'ocean/{1995,2000}' Matches all names of the forms ocean/1995 or ocean/2000.
~ Fast Shorthand for a user's top-level directory '~/data' If the user's CISL logon name is BART, it expands to  /BART/data.
Shorthand for another user's top-level directory '~lisa/data' Expands to /LISA/data.

Warning

The old msread and mswrite commands do not behave the same way as the DCS commands for shell patterns. Any shell patterns for DCS commands must be escaped to protect them from the user's local shell. For example:
mswrite local_file '/USER/A***'
will produce a file on the MSS with the name of /USER/A***. If you then were to try:
msrm '/USER/A***'
you would remove all files starting with /USER/A. To remove this file, you must use:
msrm '/USER/A\*\*\*'