ncr2rq
Last Updated: November 23, 2016
·
590
· fluxsauce
E5529d996db3f33b95a95a28e7a1b923  1

Get the Drupal major version using Drush

You know, for kicks.

drush status | grep "Drupal version" | awk -F ':' '{print $2}' | sed 's/^ *//'
Say Thanks
Respond

1 Response
Add your response

28336
2013 0904 134455 gk cropped

Could be done with only drush with with a few options:
drush @site status --fields=drupal-version --field-labels=0

If you only want the major version of Drupal you can use awk to get only that:
drush @site status --fields=drupal-version --field-labels=0 | awk -F. '{print$1}'

over 1 year ago ·