
The ECN No Name Newsletter is no longer being published. This is an archived issue.
[previous article] [next article]Every semester, I teach a course on "Meta Characters". Invariably I am asked, "What are they?" Sometimes you hear reference to "special characters", "shell pattern matching", "filename globbing", or even having the "MAGIC on" while in the editor. These funny characters, have funny names like:
! = bang ? = question mark ( = left paren
* = star = = equals ) = right paren
$ = ding or | = vertical bar { = open curly
dollar sign or pipe brace
# = crunch @ = at } = curly close brace
\ = backslash % = percent [ = left bracket
. = dot + = plus ] = right bracket
- = dash _ = underbar ~ = tilde
^ = caret or & = ampersand < = less than
hat > = greater than
META CHARACTERS are used in editor commands/UNIX commands to make typing easier and to do pattern matching work. Some meta characters are:
* any (including zero) character matches
? match any single (one) character
{ } match each of the choices inside braces
[ ] match one out of the choices inside brackets
* any (including zero) character matches
. one character
[ ] match one out of the choices inside brackets
[^...] match NONE out of the choices inside brackets
^ Beginning of the line
$ End of the line or File
CSH users have an additional alternative to meta character usage for automatic expansion of filenames. This expansion power permits a partial filename to be typed in at the UNIX prompt followed by the depression of the "ESC" key. UNIX then tries to expand the name to match the files in the directory.
To make use of this expansion power for all terminal sessions, type "set filec" in your .cshrc file, or to have this functionality for the current terminal session ONLY, type at the UNIX prompt "% set filec" .