KSH – HP-SOL-Lin
Needs to be POSIX
I want to test if multiple conditions are true, then do something.
Assumptions:
FIELDS=0$STRING=''or$STRING=' '
Right now I have:
if [[ $FIELDS -ne 0 && ! -z $STRING ]]; do
This works fine, if $STRING is null, but sometimes it has a single space. How can I make process the two $STRING tests first? Conceptually, I would like equivalent of:
[[ $FIELDS -ne 0 && [ ! -z $STRING || $STRING = ' ' ] ]]
You can separate the tests: