I have a file with the following 3 lines:
file.txt
aaa|
bbb|
ccc|
and another file with one line:
regex.txt
^aaa\|
$grep ^aaa\| file.txt
yields:
aaa|
$grep -f regex.txt file.txt
yields:
aaa|
bbb|
ccc|
Why are the results different for grep -f
and grep
?
$grep -V
grep (GNU grep) 3.1
$lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.1 LTS
Release: 18.04
Codename: bionic