I have a function foo and a variable bar. I want to write a bash conditional that checks that bar is set and that foo returns positive.
I understand that you can write the two conditions as
if [ -z "$foo"]
and
if foo $myparam1 $myparam2
How can I combine these into a single expression? Something like
if [-z "$foo" -a $(foo $myparam1 $myparam2) != '1']