shell-expansion.wht (1338B)
1 Shell Parameter Expansion 2 ________________________________________________________________________________ 3 4 [000] Index 5 ________________________________________________________________________________ 6 * ........................................................................ [000] 7 8 [000] 9 ________________________________________________________________________________ 10 11 ${VARxDEFAULT} 12 13 Colon tests for set and not an empty string 14 No colon tests for only set/unset 15 16 +---------+------------+---------------+----------------+ 17 | Pattern | $VAR unset | $VAR is empty | $VAR not empty | 18 +---------+------------+---------------+----------------+ 19 | - | default | $VAR | 20 +---------+------------+---------------+----------------+ 21 | + | nothing | default | 22 +---------+------------+---------------+----------------+ 23 | :- | default | $VAR | 24 +---------+------------+---------------+----------------+ 25 | :+ | nothing | default | 26 +---------+------------+---------------+----------------+ 27 | := | VAR=default | $VAR | 28 +---------+------------+---------------+----------------+ 29 | :? | exit with def as message | $VAR | 30 +---------+------------+---------------+----------------+ 31