From 9a40498eed47e8388646f6a2bb3b8c4488c58214 Mon Sep 17 00:00:00 2001 From: Manuele Simi Date: Tue, 16 Feb 2021 15:09:07 -0500 Subject: [PATCH] Add message with results to grep HTTP action. --- 27-01-2021-grepString/grepHttp.sh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/27-01-2021-grepString/grepHttp.sh b/27-01-2021-grepString/grepHttp.sh index 58c8e30..f6101a8 100644 --- a/27-01-2021-grepString/grepHttp.sh +++ b/27-01-2021-grepString/grepHttp.sh @@ -1,8 +1,4 @@ #!/usr/bin/env bash - -if [[ "$(find . -name '*.java' -exec grep 'http://' /dev/null {} +)" ]]; then - echo "http protocol found" -else - echo " http not found" -fi - +message="HTTP protocol found" +find . -name '*.java' -exec grep 'http://' /dev/null {} + || message="HTTP protocol not found" +echo "--- ${message} ---" \ No newline at end of file