Bash script for run command on all subdirectories (i.e. "drush up" for all sites)

Public

Put file in home dir, chmod 744, change "cd {}/public_html" to your drupal dir. Run: /bin/bash /home/user/subdir.sh "drush up --security-only --no-core -y"

Get raw version
bash
  1. #!/bin/bash
  2.  
  3. echo $1;
  4.  
  5. cd domains/
  6.  
  7. find . -maxdepth 1 -type d -exec bash -c "(cd {}/public_html && echo '$(tput bold)$(tput setaf 1)ENTER: $(tput setaf 2){}$(tput sgr 0)' && $1)" ";"