Lines Matching full:unset
126 'unset VAR; set +a; VAR=value; env | grep "^VAR="'
130 'unset VAR; set -a; VAR=value; env | grep "^VAR="'
353 atf_set "descr" "Tests that 'set -u' turns on unset var detection " \
359 # first make sure it is OK to unset an unset variable
361 'unset _UNSET_VARIABLE_; echo OK'
364 'unset _UNSET_VARIABLE_; echo OK'
366 # and that without -u accessing an unset variable is harmless
368 'unset X; echo ${X}; echo OK'
369 # and that the unset variable test expansion works properly
371 'unset X; printf "%s" ${X-OK}; echo OK'
373 # Next test that with -u set, the shell aborts on access to unset var
376 'unset X; set -u; echo ${X}; echo ERR'
379 'unset X; set -u; echo "${X}"; echo ERR'
381 # Now a bunch of accesses to unset vars, with -u, in ways that are OK
383 'unset X; set -u; echo ${X-GOOD}; echo OK'
385 'unset X; set -u; echo ${X-OK}'
387 ${TEST_SH} -ce 'unset X; set -u; echo ${X+ERR}; echo OK'
391 'unset X; set -u; echo ${X#foo}; echo ERR'
393 'unset X; set -u; echo ${X%%bar}; echo ERR'
395 # lastly, just while we are checking unset vars, test aborts w/o -u
397 'unset X; echo ${X?}; echo ERR'
399 ${TEST_SH} -c 'unset X; echo ${X?X_NOT_SET}; echo ERR'