Essentially I have a script which acts as a task wrapper and emails a user if the task fails.
The task is passed in as an argument to the script. The problem comes when we need to run multiple commands say the following line is passed to the script as the task arg
"echo this; echo that" would output this; echo that.
So the question is what is the easiest way to run multiple commands without having to loop through the input command string and split on the ';' char?
FIRST=$1 TASK=$* echo run echo "emailing $FIRST" $TASK echo done
and to run this script we would use
./wrapper.sh "[email protected]" "echo this; echo that"