From 5afc9efc0e0af518de1d6fe867d88b6865e75545 Mon Sep 17 00:00:00 2001 From: Manuele Simi Date: Fri, 12 Feb 2021 14:50:22 -0500 Subject: [PATCH] Simplify the command in grepHTTTP and print the files where the string is found. --- 27-01-2021-grepString/grepHttp.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/27-01-2021-grepString/grepHttp.sh b/27-01-2021-grepString/grepHttp.sh index 2daf584..6e23043 100644 --- a/27-01-2021-grepString/grepHttp.sh +++ b/27-01-2021-grepString/grepHttp.sh @@ -1,6 +1,3 @@ #!/usr/bin/env bash -if [[ "$(find . -name *.java | xargs grep 'http://')" ]]; then - echo "http protocol found" -else - echo "http protocol not found" -fi \ No newline at end of file + +find . -name '*.java' -exec grep 'http://' /dev/null {} + \ No newline at end of file