ArGest Backup User Guide

  1. Home
  2. Docs
  3. ArGest Backup User Guide
  4. Terminal Extract Files: The Restore Function
  5. Using Wildcard File Name Expansion

Using Wildcard File Name Expansion

BRU recognizes wildcard strings in the same format as recognized by the Bourne or Korn shells. However, when such strings are passed to BRU in extract mode, they must be quoted to prevent their expansion by the shell. For example, the following command will extract all files in any subdirectory one level below the current directory that start with any character between “a” and “h” and end with “.c”; it will also extract all files in any subdirectory three levels down:

bru -x “./*/[a-h]*.c” “./*/*/*”

The command in the next example will extract all files in the ./etc subdirectory that do not end in “.old” (the “!” operator is a BRU enhancement of wildcard expansion that does not exist in the shell):

bru -x “./etc/!*.old”

Use the “!” operator with extreme caution. In particular, since each pattern is applied independently to determine a match, be wary of including more than one pattern with a “!” operator on the command line. For example, the pattern “!file1 !file2” will match all files, including files “file1” and “file2”. Since “!file1” matches pattern “file2” and “!file2” matches pattern “file1”, you have defeated the exclusion.

The “!” is mostly useful for simple exclusion tasks such as excluding a single file. For other file exclusions, it is usually easier to use the -X option. See Chapter 6, “File Inclusion and Exclusion.” NOTE: Wildcard characters used to specify file names in -x mode must be enclosed in double quotes. Wildcard characters used with -c are not quoted.