#!/bin/bash function do_compile { for dir in `ls` do if [ -f $dir/build*.sh ] ; then cd $dir ./build*.sh cd - fi done } do_compile