#! /bin/sh base_path="${1}"; command="${2}"; for item in $base_path/*; do if test ! -d $item; then #echo "\"${item}\" is not a directory"; continue; fi if test ! -f "${item}/composer.json"; then #echo "\"${item}\" is not a composer package"; continue; fi cd ${item}; composer ${command}; cd -; done