#!/bin/sh # run all executable *.sh scripts in the provided directory # check command line if [ $# -ne 1 ] ; then echo 'usage: run-all {dir}' exit 1 fi # change to the directory, and run all executable *.sh files cd "$1" for script in *.sh ; do [ -x "$script" ] && ./$script done