#!/bin/bash EXEC_DIR=$(pwd) FILE_TO_EXECUTE=$1 if [ ! -z $1 ] then echo "Execute " $1 " in each system" else echo "Execute foreachSystem failed, because no parameter was provided" exit fi for SYSTEM in systems/*/*/ ; do echo "executing ${FILE_TO_EXECUTE} in ${SYSTEM}" cd $SYSTEM ./bin/script/$FILE_TO_EXECUTE cd $EXEC_DIR done