#!/usr/bin/env bash # usage ./mulitsite-drush-command.bash path_to_sites_directory command # path_to_sites_directory is the full path drupals sites directory (something like /var/www/drupal/web/sites) # and command is a drush command [ $# -ne 0 ] && { echo "Usage: $0 path_to_sites_directory drush_command"; exit 1; } cd "$1" pwd list="$(find ./ -maxdepth 1 -type l)" for link in $list ; do cd "$link" pwd ../../../vendor/bin/drush "$2" --yes cd "$1" done exit