diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2002-04-29 00:59:36 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2002-04-29 00:59:36 +0000 |
commit | c3e2a5eeb70f1de57109cc99245c9f814e4123ff (patch) | |
tree | cded98747799acd1ae08cfa8a29902fcf580535a /share | |
parent | 20233ef4e9de159686e18e2c6370f297e9825581 (diff) |
Rely on [] evaluating empty string as false, non-empty string as true
to eliminate a lot of -z and -n tests.
Thus,
'[ -z "$x" ] && cmd' -> '[ "$x" ] || cmd'
'if [ -z "$x" ]; then; y; fi' -> '[ "$x" ] || y'.
'[ -n "$x" ]' -> '[ "$x" ]'
Use variable default value syntax in a couple of places rather than if
statements. e.g. ': ${_ouranswer:=$_ifs}'.
Suggestions from millert@, aaron@, espie@, miod@ at various times.
Diffstat (limited to 'share')
0 files changed, 0 insertions, 0 deletions