⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 set-e.tests

📁 android-w.song.android.widget
💻 TESTS
字号:
if : ; then	set -e	N=95	while :; do		# expr returns 1 if expression is null or 0		set +e		N_MOD_100=`expr $N % 100`		set -e		echo $N_MOD_100		N=`expr $N + 1`		if [ $N -eq 110 ]; then			break		fi	done	set +efi(set -efalseecho bad)echo $?x=$(set -efalseecho bad)echo $? $x# command subst should not inherit -eset -eecho $(false; echo ok)if set +ethen	falsefiecho hiset -e# a failing command in the compound list following a while, until, or# if should not cause the shell to exitwhile false; do	echo hidoneecho while succeededx=1until (( x == 4 )); do	x=4doneecho until succeeded: $xif false; then	echo oopsfiecho if succeeded# failing commands that are part of an AND or OR list should not# cause the shell to exitfalse && echo AND list failedecho AND list succeededfalse || echo OR list succeeded! falseecho ! succeeded# make sure eval preserves the state of the -e flag and `!' reserved wordset -eif eval false; then	echo oopsfiecho eval succeeded! eval falseecho ! eval succeeded -- 1! eval '(exit 5)'echo ! eval succeeded -- 2set -euntil builtin false; do echo a; break; doneecho $?until eval false; do echo b; break; doneecho $?: ${TMPDIR:=/tmp}FN=$TMPDIR/set-e-$$cat > $FN << EOFfalseecho after 1falseEOFset -euntil . $FN; do echo a; break; doneecho $?rm -f $FNset +e${THIS_SH} ./set-e1.sub${THIS_SH} ./set-e2.sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -