Change tcsh's default no match behavior

Mar 14, '02 09:57:14AM

Contributed by: tz

tcsh will consider it an error if it can't find a file matching an expression, and instead of executing it, it will print [cmd]: No Match. This makes it difficult to do things like:

find . -name [Mm]ac*
which works in bash (I do that a lot on linux as bash is the default shell). It takes some effort to properly escape the bracketed area, and I normally don't want to quote everything.

Another example is when typing URLs - the ? is used as a separator and results in the same error. To change tcsh's behavior, simply type:
set nonomatch
This will tell tcsh to NOT consider expressions with wildcards that don't match any file an error. Most apps will tell you if things are actually missing, but in the rest of the cases where the characters are intentional, it will work.

[Editor's note: I have not tried this myself, but I do have a question on it -- anyone know how to UNSET this option once you've set it?]

Comments (9)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20020314095714397