I’m trying to write a script that takes a group of commands on the command line (similar to how you can do with the “time” command), have it execute that group of commands and then based on the error code returned do something (if your curious, I’m having it call back to a speech daemon on my desktop to echo back the command and if it failed or succeeded – using this for some long running build processes)
With the unix time command if I have a list of commands I can run
> time (do_build && deploy_build)
With my command (which i call tellme) when I try this I get
> tellme (do_build && deploy_build)
bash: syntax error near unexpected token `do_build'
It doesn’t seem to like the group of commands as parameters even though the exact same thing works fine for the time command.
Any ideas?
I’m guessing you’ll have to do something like
And inside tellme