#!/bin/sh
source error.sh

# Parameters
# ${1} == List of arguments.
# ${2} == Command to execute over list.
# ${3} == Exit on Error (true/false) 
forEachIn()
{
    for each in ${1}
    do
        ${2} ${each} 
        if [ ! -z ${3} ] && [ ${3} != "true" ] 
        then
            die "Command ${2} failed on ${each}"
        fi
    done
}
