Skip to content

Instantly share code, notes, and snippets.

@ircmaxell
Created July 8, 2012 17:15
Show Gist options
  • Save ircmaxell/3071845 to your computer and use it in GitHub Desktop.
Save ircmaxell/3071845 to your computer and use it in GitHub Desktop.
PHP Run Script
#!/bin/bash
BIN=""
if [ "$PHP" == "/usr/local/bin/php" ]
then
PHP=""
fi
BIN="/usr/local/php/$1/bin/php"
if [ -x "$BIN" ]
then
shift
else
if [ -x "$BIN" ]
then
BIN="$PHP"
else
if [ -x "/usr/local/php/$PHP/bin/php" ]
then
BIN="/usr/local/php/$PHP/bin/php"
else
BIN="/usr/local/php/master/bin/php"
fi
fi
fi
$BIN $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment