Add null condition on the second grep.

This commit is contained in:
Manuele Simi 2021-02-17 09:26:14 -05:00
parent 78866a891c
commit d7628dd125
1 changed files with 1 additions and 1 deletions

View File

@ -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 [[ -n "${out}" && "$(grep '\.java' <<< ${out})" ]]; then
echo "HTTP protocol found"
else
echo "HTTP protocol not found"