Instead of using the shell's evaluation, use grep's -q parameter. Found with shellcheck's SC2143. Also replaced a head call with grep's -m. Signed-off-by: Rosen Penev <rosenp@gmail.com>