4 Matching Annotations
- Feb 2022
-
learnbyexample.github.io learnbyexample.github.io
-
# line containing 'cake' but not 'at' # same as: grep 'cake' table.txt | grep -v 'at' # with PCRE: grep -P '^(?!.*at).*cake' table.txt $ awk '/cake/ && !/at/' table.txt blue cake mug shirt -7
It should be easier to use awk over bash, especiallly for AND conditions.
For example, for "line containing
cake
but notat
": * grep:grep 'cake' table.txt | grep -v 'at'
* grep with PCRE:grep -P '^(?!.*at).*cake' table.txt
* awk:awk '/cake/ && !/at/' table.txt
Tags
Annotators
URL
-
- Jul 2021
-
unix.stackexchange.com unix.stackexchange.com
- Feb 2020
-
github.com github.com
Tags
Annotators
URL
-
-
github.com github.com
-