0

I have a useful script greplog that does:

grep -Eh --color $1 /var/log/apache2/other_vhosts_access.log{.1,}

so I can easily search like this:

greplog index.php

But

greplog "POST /test.php"

doesn't work: it searches for POST or /test.php whereas it should be a full pattern search, with the space included. Why?

Why isn't $1 replaced by "POST /test.php"? Indeed this works fine:

grep -Eh --color "POST /test.php" /var/log/apache2/other_vhosts_access.log{.1,}
Basj
  • 2,519

0 Answers0