Adding {
}
Operators to Korn (and Bourne) Shells

Filename Wildcards tutorial

This section summarizes the wildcards that are used for filename expansion. The shells use the same basic wildcards, though csh, tcsh, ksh, and bash have some extensions. Unless otherwise noted, assume that wildcards are valid for all shells.

Note: wildcards do not match files whose names begin with a dot (), like cshrc. [1] This prevents you from deleting (or otherwise mucking around with) these files by accident. To match those files, type the dot literally. For example, [a-z]* matches anything whose name starts with a dot and a lowercase letter. Watch out for plain *, though; it matches the directory entries and (see article 15.5 for suggestions on solving that problem).

[1] Setting the bash variable glob_dot_filenames includes these names in wildcard expansion.

And a final note: many operating systems (VAX/VMS and DOS included) consider a file's name and extension to be different entities; therefore, you can't use a single wildcard to match both. What do I mean? Consider the file abc.def. Under DOS or VMS, to match this filename you'd need the wildcard expression *.*. The first * matches the name (the part before the period), and the second matches the extension (the part after the period). Although UNIX uses extensions, they aren't considered a separate part of the filename, so a single * will match the entire name.

- ML, JP