When running in FreeBSD, drush generates an error because the script tries to launch
php-cli when it doesn't exist. This problem occurs because drush relies on `bash` behaviour, but it calls its shell as
To be clear: drush *is* a Bourne shell script, but it depends on behaviour that works in Bash's implementation of Bourne shell in the way it determines the location of the PHP binary it will use.
The problem was described in http://drupal.org/node/1916326 but the two workarounds offered there were (1) to force an unnecessary dependency on bash, and (2) to avoid the problematic code by statically configuring
$DRUSH_PHP prior to running drush. While these are reasonable as workarounds, neither of them is a solution to the core problem.
The attached patch fixes this problem in FreeBSD, and also works in Linux and OSX machines I tested it on.