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.
|
|
||
165 |
|
165 |
|
166 |
|
166 |
|
167 |
|
167 |
|
168 |
|
|
|
169 |
|
|
|
|
168 |
|
|
|
169 |
|
|
170 |
|
170 |
|
171 |
|
171 |
|
172 |
|
172 |
|
|
|
||
194 |
|
194 |
|
195 |
|
195 |
|
196 |
|
196 |
|
197 |
|
|
|
|
197 |
|
|
198 |
|
198 |
|
199 |
|
199 |
|
200 |
|
200 |
|