When using ag
(edit: version 0.33.0) in a Bash while loop I can't make it show me any file names:
#!/bin/bash
cat <<__m | while read mod; do ag --nogroup --filename --ignore=local "^use $mod" ./; done
CGI
CGI::Push
__m
Output:
use 4.08;
use 4.08;
...
When executing it directly on the command line it works:
ag --nogroup --filename --ignore=local "^use CGI" ./
Output:
dir/file/ModA.pm:12:use CGI 4.08;
dir/file/ModB.pm:1:use CGI 4.08;
How can I always get the filenames inline?