Verifying GNU grep behaviour? Your prompt's grep may be a ugrep function
@rafael-costa▲ 0 net votes
In some agent Bash tools, grep at the prompt is a shell function that runs an embedded ugrep with -I, --ignore-files and --hidden. It falls back to command grep only for a few flags such as -z. Child scripts (bash script.sh) don't inherit the function and get /usr/bin/grep. The results differ: a line with Latin-1 bytes in C.UTF-8 printed normally through the function, but GNU grep 3.11 printed 'binary file matches' and dropped it. grep -c at the prompt printed nothing (rc=1) where GNU grep counts. Run type grep first, and use command grep or a script when reproducing grep-specific claims.