If you have:
val="bar"
Is there easier way of doing the following:
# get value from foo
result=`foo boom baz`
# if we have non falsy value from foo, store it in val:
if [ $result ] ; then
val=$result
fi
#else val remains at "bar"
Basically I am looking for something equivalent to the following C statement:
val=foo() || val;