I would like to filter the result of a grep command, eg :
myRepo/path/to/my/file.php:123: error_log(' - myError');
If I do the following, it works.
echo " myRepo/path/to/my/file.php:123: error_log(' - myError');" | awk -F': ' '{print $1}'
But when it's the result of a grep command, it outputs the whole line, why ?
grep -rn "myError" | awk -F': ' '{print $1}'
I have CentOS 6 with Awk 3.1.7, bash 4.1.2