When I execute ./drush, I get:

/usr/bin/env: bash: No such file or directory

I am a novice at all this and so I am not sure what to do.

I searched the issues and did not find a "No such file or directory" related to bash.

When I do a "which bash" I get:


Any help would be very much appreciated.



drupaloo’s picture


/usr/bin is in $PATH

I also put /bin in the path but this did not help.

My Hosting co. took a look at it and they say:

Unfortunately it doesn't look like this is going to be able to run on our server in a jailshell environment. We have tried serveral ways to get this script to run but it is not working as it is not allowing access to /usr/bin/env.

jonhattan’s picture

Status: Active » Fixed

`drush`is just a wrapper and the real drush is `drush.php`. There're several ways you can workaround your issue:

1. `/bin/bash ./drush`
2. `php drush.php`
3. edit `drush` and change the first line of the script to just `/bin/bash`
4. same as 3) but with `drush.php` and `/usr/bin/php`

I'll mark the issue as fixed. Feel free to reopen if no success.

drupaloo’s picture

Status: Fixed » Active

Dear jonhattan,

Thank you very very much for your help!
I learned how to use drush on my local dev machine and saw how useful it is, how much time it saves.
I was very disappointed when my hosting co. said drush could not run.
So you have helped me a great deal!

I tried the first 3 of your options.

'/bin/bash ./drush' and `php drush.php` work but unfortunately only in the drush folder. If I switch to another directory I get:

For /bin/bash ./drush I get:
./drush: ./drush: is a directory

For php drush.php I get:
Could not open input file: drush.php

Option 3 - edit `drush` and change the first line of the script to just `/bin/bash` -

I changed #!/usr/bin/env bash to #!/bin/bash and that worked in other directories as well!

Thanks again! Your help will save me hours of work in the future.

drupaloo’s picture

Status: Active » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

mcrittenden’s picture

For anyone that had a 'bad interpreter' error after doing this, the following command solved it for me. From inside the drush directory:

mv drush drush.bak; tr -d '\r' < drush.bak > drush

From http://www.linuxquestions.org/questions/linux-general-1/bad-interpreter-...