Shell problem with remote hosts I'm having a problem when executing a drush command on a group of aliases that are all remote.

When I do this:

drush -y @group.host1 status -v


all works fine.

When I do that:

drush -y @group status -v


it fails with the following message for each host in that group:

ssh -o PasswordAuthentication=no host1 'DRUSH_PHP=/usr/bin/php drush  --backend=2 --verbose --yes --uri=www.example.com --root=/var/www --reserve-margin=28  status 2&gt;&amp;1' 2&gt;&amp;1
fish: Unknown command 'DRUSH_PHP=/usr/bin/php'. Did you mean to ru
n drush with a modified environment? Tr
y 'env DRUSH_PHP=/usr/bin/php drush…'. See the help section on the set command by typing 'help set'.
Standard input: DRUSH_PHP=/usr/bin/php drush  --backend=2 --verbose --yes --uri=www.example.com --root=/var/www --reserve-margin=28  status 2&gt;&amp;1


So, how I read the error it looks like fish (which is the shell used instead of bash) is having an issue with the command

ssh -o PasswordAuthentication=no host1 'DRUSH_PHP=/usr/bin/php drush  --backend=2 --verbose --yes --uri=www.example.com --root=/var/www --reserve-margin=28  status 2&gt;&amp;1' 2&gt;&amp;1


Now what's the difference when I call the same thing for @group.host1 instead of @group? Then the command looks like this:

ssh -o PasswordAuthentication=no host1 'drush  --backend=2 --verbose --yes --uri=www.example.com --root=/var/www --reserve-margin=28  status 2&gt;&amp;1' 2&gt;&amp;1


The difference is that the leading "DRUSH_PHP=/usr/bin/php" is missing and then it works fine.

I have played around with /usr/bin/drush and removed the option --php="$php" from the last line in that file, and then everything works fine again too.

Important: This only happens since I've upgraded to Drush version 6.2 - before I had 6.0 on my local laptop and 5.9 on the host1.
Drush was designed for use with bash, not fish.  Would it be an option to make your login shell bash for your remote Drush user?

Your other option would be to submit a patch to Drush to fix this problem.  There are two possibilities:


Modify Drush to use env DRUSH_PHP=... in backend invoke.
Modify Drush to not pass --php when --remote-host is set.


Option (1) may be harmful to remote sites where env is not in the PATH, so it may be a dubious proposition.  It might be okay, though; env is probably in the PATH on most systems.

Option (2) seems better.  There is little reason to think that the path to php will be the same on a remote system as it is on the local system, so Drush probably shouldn't be assuming that the php option is relevant for remote aliases, unless it was set in the alias' %path section.

Either of these actions would require a discussion in the Drush issue queue.