0

Does drush have built-in or predefined variables or macros?

An example would be like the base directory of the Drupal installation, database name, passwords etc? Something like the values displayed in drush status

1
  • Doesn't variables exist as a permissible tag? It is forcefully converted to persistent-variables
    – vfclists
    Oct 2, 2013 at 18:56

1 Answer 1

1

If you source the file examples/example.bashrc from your ~/.bashrc file, then you can do useful things like cd %root or cd @site:%root. Without sourcing that file, you can use cd $(drush dd %root). If you want to go to a module or theme directory, cd $(drush dd %devel) also works. Using the %path aliases without qualifying them with a @site alias does, of course, require that your cwd be inside some Drupal site (or $options['root'] must be set in some drushrc.php file).

2
  • I take it that the '@', '%' are bash symbols, that drush doesn't have its own special syntax or prefixes that are separate from shell/bash prefixes which refer to settings in drushrc or some other drush related values that can be computed from the Drupal environment and the current directory? (a bit of a mouthful, I hope you get the drift :))
    – vfclists
    Oct 11, 2013 at 12:31
  • 1
    No, $ is used for Bash variables. @ and % are interpreted by Drush. %root is calculated based on the cwd. Oct 11, 2013 at 14:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.