Hi!
$ more file
yoyo haha lili
...
i want to test if a "grep yoyo AND lili" works in this file.
In fact, my script will carry on only if it finds in the same line "yoyo" AND "lili"
How can i do?
Thx!
Hi!
$ more file
yoyo haha lili
...
i want to test if a "grep yoyo AND lili" works in this file.
In fact, my script will carry on only if it finds in the same line "yoyo" AND "lili"
How can i do?
Thx!
i haven't seen AND being used.... but u can perhaps use grep -e
# grep -e yoyo -e lili file
Also check the man pages for grep, egrep & fgrep
Also you can use
# egrep -i 'yoyo|lili' file
How about:
grep -q lili file && grep -q yoyo file && print "found both"