Wildcard Matching
You can quickly send or get multiple files at once using local or remote pattern matching. The patterns are formed by including wildcard characters in the source pathnames. The exact syntax of the patterns depends on whether they are local or remote, and what operating systems are being used.
The behavior of wildcards may vary depending on the operating system of the server. For example, Windows only supports wildcards in the base name of the file, not in the path name. You can test which files will match a pattern by using the "-F" option.
* Star, Asterisk, Splat
This matches zero or more characters in a pathname component. For example, applying the pattern t*.txt to the following file list:
test1.txt
myfile.txt
twenty.dat
tuesday.dat
would match test1.txt and tuesday.txt, but not myfile.txt and not tuesday.dat. The star wildcard is supported in both Windows and Unix.
? Question Mark
This matches exactly one character in a pathname component. For example, applying the pattern test?.txt the following file list:
test1.txt
test17.txt
test2.txt
test3.dat
would match test1.txt and test2.txt, but not test17.txt and not test3.dat. The question mark wildcard is supported in both Windows and Unix.
[ Bracket
This construct matches a range of single characters in a pathname component. For example, applying the pattern test[1-3].txt the following file list:
test1.txt
test17.txt
test2.txt
test3.dat
test4.txt
would match test1.txt and test2.txt, but not test17.txt, test3.dat, nor test4.txt. The bracket wildcard is not supported by Windows.
Upper vs. Lower Case
Windows and MacOS X allow file names to match if they differ only by the case of some letters. Most other unix filesystems require an exact match. It is best to avoid using filenames that differ only by the case of some letters, and try to match case exactly.
Character Escaping
When you are using wildcards to match local files for sending, the pattern must be parsed by your local command shell. But when you want to use wildcards to download remote files, the local shell must pass the pattern through unchanged so that the server can see them.
In unix, you can tell the shell to ignore wildcards either by enclosing the entire parameter in quotes, or by preceeding each wildcard with a backslash. For example:
movedat me@myserver:subdir/files\*.txt mydir
movedat "me@myserver:subdir/files*.txt" mydir
In Windows, you can escape wildcards by using quotes:
movedat "me@myserver:subdir/files*.txt" C:\mydir
If you are having trouble getting wildcard patterns to work ("no match" errors), make sure that your remote download patterns are escaped, and that your local send patterns are not.