Posted by okokokok on April 25, 2010 at 1:51pm
I want my drush scripts to be executable (without typing drush php-script NAMEOFSCRIPT.php) so I created a file /usr/local/bin/drush-script: drush php-script $1
chmod +x NAMEOFSCRIPT.php
and NAMEOFSCRIPT.php now starts with #!/usr/bin/env drush-script
Now it would be nice to get rid of the drush-script file. Unfortunately #!/usr/bin/env drush php-script doesn't work as it will look for the file 'drush php-script' instead of passing php-script as the first parameter. Is there a way to pass this parameter in some other way?
Comments
Take a look at "drush cli"
If you use the
drush clicommand in drush 3.0 stable, you will enter a new bash subshell where every drush command has been aliased as a shell function, so you may then just type "sql-conf" instead of "drush sql-conf".For making aliases to your own drush-script commands, try this:
alias myscript="drush php-script myscript.php"Then you can run 'myscript' with no args and no prefix.