drush php-script

Run php script(s).

Drush Command

drush php-script


filename : Optional. The file you wish to execute (without extension). If omitted, list files ending in .php in the current working directory and specified script-path. Some might not be real drush scripts. Beware.


drush scr


--script-path : [object Object]


Run scratch.php script. See commands/core directory.

drush php-script scratch
Run script from specified paths
drush php-script example --script-path=/path/to/scripts:/another/path
List all available scripts.
drush php-script
Execute php code with a full Drupal bootstrap directly from a shell script.
#!/usr/bin/env drush
variableset('key', drushshift());