From 08296aacd24dd0a3bfb7b60ac9295155e7fc8597 Mon Sep 17 00:00:00 2001 From: Manuele Simi Date: Tue, 16 Feb 2021 15:23:46 -0500 Subject: [PATCH] Improve grep syntax. --- 27-01-2021-grepString/grepHttp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/27-01-2021-grepString/grepHttp.sh b/27-01-2021-grepString/grepHttp.sh index 318a2d8..182c343 100644 --- a/27-01-2021-grepString/grepHttp.sh +++ b/27-01-2021-grepString/grepHttp.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash out=`find . -name '*.java' -exec grep 'http://' /dev/null {} +` echo "${out}" -if [[ "$(grep 'java' ${out})" ]]; then +if [[ "$(grep '\.java' <<< ${out})" ]]; then echo "HTTP protocol found" else echo "HTTP protocol not found"