So under Linux/AIX where ever.., when is it useful to use:
grep -- SOMEPATTERN
the Question is the "--" part. When is it usefull to use?
When "SOMEPATTERN" starts or may start (for instance if it's a variable like
Also with GNU grep (unless
Alternatively, you can do
When the pattern starts with a dash, otherwise grep will think it is an option. Say, you are looking for "-a" in a text:
grep will then try to find the pattern "file.txt" in the standard input, using the option