So under Linux/AIX where ever.., when is it useful to use: grep -- SOMEPATTERNthe Question is the -- part. When is it usefull to use?
When is it useful to use grep -- SOMEPATTERN?
bash;grep;ksh
When SOMEPATTERN starts or may start (for instance if it's a variable like $PATTERN which you don't have full control on) with a - (dash) character.Also with GNU grep (unless $POSIXLY_CORRECT is on), it's useful if other arguments (file names) may start with -.Alternatively, you can dogrep -e -SOMEPATTERN- -- file1 file2 -xxx--- marks the end of options. It's useful everywhere where non-option arguments may start with a dash, and it doesn't harm, so it's a good habit to use it.