5c17ec2 Avoid grep ambiguities

Authored and Committed by Alois Mahdal 5 years ago
    Avoid grep ambiguities
    
    Where regular expression is read from a variable and -e argument is not
    provided, the resulting call may end up being interpreted as grep
    argument,  This can be pretty dangerous, eg. if the variable expands to
    `--help`, grep help is shown and grep exits with zero, which would be
    interprered as match.  Another example is when the variable expands to
    a valid grep parameter; this would mean that next argument would be
    interprered by grep as the regex, and if the argument after that would
    be missing, grep would read stdin, resulting in data messup or grep
    waiting
    indefinitely.
    
    See also:
    
        https://github.com/koalaman/shellcheck/issues/1342
    
        
file modified
+1 -1
file modified
+3 -3
file modified
+2 -2
file modified
+2 -2