#!/bin/bash EXITCODE=0 if [[ -z $1 ]] then FILES=app else FILES=$1 fi for f in $(find $FILES -name '*.php') do php -l $f if [ $? -ne 0 ] then EXITCODE=1 fi done exit $EXITCODE