Am I missing something?
foo | not
...looks better than this to me:
#!/bin/sh
if [[ `foo` ]]; then
exit 1
else
exit 0
fi
Conversation
Replying to
yes, you're looking for "!" (e.g. ! false && echo foo, but it also works for return: ! return 1)
2
a notable exception would be exit, but there you can do "exit $?"
1
hmm not all of this syntax seems to be portable - but should solve most of your problems

