This is either dead simple or can't be done, but after hours of looking I'm stumped. Just started using bash for an Apple script.
show_name=${BASH_REMATCH[1]} #show_name is declared
test "$show_name" == "Smash" && {show_name="Smash (2012)"} #redeclare the value from 'Smash' to 'Smash (2012)
Also tried some variations e.g.
test "$show_name_temp" == "Smash" && (show_name="Smash (2012)"; exit 1)
However the value show_name never gets redeclared. The if statement is definitely working because if I put an echo "hello, world" in, it prints.
I'm coming from PHP though, so my desktop syntax is lacking.
Thanks guys
=as an operator, not==; the latter is a GNU extension, and using it makes your code less portable.