How can I make grep read the expression from standard input (stdin)?
For example (the following doesn't work):
grep -i -f &0 /path/to/text/file < "/regexp/"
How can I make grep read the expression from standard input (stdin)?
For example (the following doesn't work):
grep -i -f &0 /path/to/text/file < "/regexp/"
Use
-f
with a single dash to denote the standard input:Note: This has been tested with GNU grep - I am not sure if it's specified by POSIX.