# zopen exports a long CFLAGS; IBM grep warns (FSUM9950) on long input lines. grep() { command grep "$@" 2>/dev/null; } a=1; export a; export b=2 c; c=3 $TSH -c 'echo $a $b $c' export -p | grep -c '^export [abc]=' readonly r=ro; readonly -p | grep -c ' r=' (r=x) 2>/dev/null; echo "assign ro $?" (unset r) 2>/dev/null || echo "unset ro fails" (readonly r=y) 2>/dev/null; echo "re-readonly $?" x=5; unset x; echo "[${x-unset}]" unset nonexistent_var; echo "unset missing $?" unset -v a; $TSH -c 'echo "[${a-gone}]"' f() { :; }; unset -f f; (f) 2>/dev/null; echo "func gone $?" v=shell; v=env $TSH -c 'echo $v'; echo $v v=temp eval 'echo $v'; echo $v v2=persist :; echo $v2 g() { echo "in g: $t"; }; t=tmp g; echo "after g: [${t-unset}]" set | grep -c '^v2=' q='a b'; set | grep '^q=' e=; set | grep '^e=' IFS=' '; set | grep -c '^IFS='; unset IFS x=1; x=$((x+1)); x=$x$x; echo $x PATH=$PATH:/extra; case $PATH in */extra) echo 1;; *) echo 0;; esac HOME=/tmp; cd; pwd; echo $PWD $OLDPWD | grep -c tmp cd /; cd - | head -1 cd /nonexistent 2>/dev/null || echo "cd fails" mkdir -p $HOME/zt.$$/a/b; cd $HOME/zt.$$/a/b; cd ..; pwd | sed "s/$$/N/"; cd ../..; rm -r zt.$$ echo ${PWD:+pwd-set} ${OLDPWD:+oldpwd-set} set -a; auto=exported; set +a; $TSH -c 'echo $auto' n=5; while [ $n -gt 0 ]; do n=$((n-1)); done; echo $n a=b; b=c; eval echo \$$a long=x; i=0; while [ $i -lt 12 ]; do long=$long$long; i=$((i+1)); done; echo ${#long} PS1='custom> '; echo "$PS1" echo "${PPID:+ppid} ${IFS+ifs}" | sed -n l OPTIND=1; echo $OPTIND set -- a b c; echo "$# $1"; set -- "$@" d; echo "$# $4"; set x; echo $# $1 shift; echo $#