Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
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:
/bin/bash
Any help would be very much appreciated.
Thanks!
Comments
Comment #1
drupaloo-1 CreditAttribution: drupaloo-1 commentedPS:
/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.
Comment #2
jonhattan`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.
Comment #3
drupaloo-1 CreditAttribution: drupaloo-1 commentedDear 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.
Comment #4
drupaloo-1 CreditAttribution: drupaloo-1 commentedComment #6
mcrittenden CreditAttribution: mcrittenden commentedFor anyone that had a 'bad interpreter' error after doing this, the following command solved it for me. From inside the drush directory:
From http://www.linuxquestions.org/questions/linux-general-1/bad-interpreter-...