Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'controlling glob-ing' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
controlling glob-ing
Authored by: hayne on Mar 14, '02 01:35:06PM

As 'el bid' has already responded, the correct way to do such things as your 'find' example is by quoting the meta-characters (*, ?, etc). There is no way arround this if what you want is for the pattern matching to be done by 'find' instead of by the shell.

But if you really want to stop the shell from doing the pattern matching, you can set the shell variable 'noglob' via the command:
set noglob
To revert back to the usual state where the shell does the pattern matching:
unset noglob
(The 'unset' command is the answer to the editor's query about how to turn off the 'nonomatch': unset nonomatch )

And, by the way, if you want to see the result of the shell's pattern matching, the usual recommendation is to do a command like 'ls' using the same pattern before trying it with something more dangerous (like 'rm') or time-consuming. But tcsh supplies an alternative: you can get it to expand your command line in place by means of the "expand-glob" editor command. To use this, you type your command (e.g. ls g*.html ) and then (before hitting return) type control-X and then *



[ Reply to This | # ]