Marc Chamberlin wrote:
grep insists that the first pattern it gets is its search pattern. Even if you have a file called 'run' in the current directory, it's going to look for that string. If you don't put anything after the pattern, it's going to search stdin.
That's right, but he put "*" after the pattern, which expands to every file in the curdir. If he was doing a recursive grep, he could use "grep PAT -r .", instead.
The answer that I got, (at least my interpretation of the answers) was that it failed because there are file names in the directory which had the string "run" within the filename...
==== Er... What I said was: "Likely some file name is being taken as a grep option".... Sorry, but not to do w/string(pattern) "run". So if you have files in some dirs like: "--blah" "-?", and do a: <SOMECMD> arg1 * That will expand to: <SOMECMD> arg1 "files..." --blah "more files..." -? "and maybe more files... (where "<SOMECMD>" may be one of many commands that do this)... Files names like "--blah" or "-?" can be any filenames that might confuse commands because they look like a possible option. The "--" is a common option to many commands that usually means: "end of options": don't parse anything after this as an option. The code that parses '--' is in each command that honors that convention (it's not a shell function). -linda -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org