 <pre><code>DOIT="" for f in file1.sh file2.sh; do if [ -x /home/$f ]; then DOIT="/home/$f"; break; fi done if [ -z "$DOIT" ]; then echo "Files not found, continuing build"; fi if [ -n "$DOIT" ]; then $DOIT &amp;&amp; echo "No Errors" || exit 1; fi </code></pre> <p>For those confused about my syntax, try running this:</p> <pre><code>true &amp;&amp; echo "is true" || echo "is false" false &amp;&amp; echo "is true" || echo "is false" </code></pre>