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