[Cialug] sed -e -e

Nicolai nicolai-cialug at chocolatine.org
Thu May 9 14:33:37 UTC 2019


On Wed, May 08, 2019 at 12:02:55PM -0400, Todd Walton wrote:
> As an aside, I sometimes wish I could do that with grep, instead of
> using pipes. Like, grep a file for lines that contain "pattern1" *and*
> "pattern2": grep -e "pattern1" -e "pattern2" file

Maybe I misunderstand you because you can use -e with grep:

$ cat names.txt
alice
bob
puffy
morpheus
$ grep -e alice -e puffy names.txt
alice
puffy
$ grep -e e names.txt
alice
morpheus

Nicolai


More information about the Cialug mailing list