use grep -q instead of test -n