Manage empty results.

This commit is contained in:
Manuele Simi 2021-02-17 09:35:05 -05:00
parent d7628dd125
commit ce191006c6
1 changed files with 3 additions and 3 deletions

View File

@ -1,7 +1,7 @@
#!/usr/bin/env bash
out=`find . -name '*.java' -exec grep 'http://' /dev/null {} +`
echo "${out}"
if [[ -n "${out}" && "$(grep '\.java' <<< ${out})" ]]; then
out=`find . -name '*.java' -exec grep 'http://' /dev/null {} + || echo 'empty'`
if [[ ["${out}" != "empty"] && "$(grep '\.java' <<< ${out})" ]]; then
echo "${out}"
echo "HTTP protocol found"
else
echo "HTTP protocol not found"