📄 posixexp.tests
字号:
unset aprintf "%s\n" ${a:=a\ b}echo "$a"unset vrecho ${v=a\ b} x ${v=c\ d}unset vrecho "${v=a\ b}" x "${v=c\ d}"unset a vrecho "foo ${IFS+'bar'} baz"recho "a ${IFS+b c} d"recho "a ${IFS+"b c"} d"u=xrecho "foo ${IFS+a$u{{{\}b} c ${IFS+d{}} bar" ${IFS-e{}} baza=foorecho "${IFS+'$a'}"recho "${IFS+"'$a'"}"recho ${IFS+'$a'}recho ${IFS+"'$a'"}unset a ux='foo*bar'recho "${x##"}"}"recho "${x##'}'}"recho "${x##'}"recho "${x:-'}'}"foo="x'a'y"recho "${foo%*'a'*}"unset xunset uv=wprintf '<%s> ' ${u+x} . ${v+x} . "${u+x}" . "${v+x}" .; echoprintf '<%s> ' ${u-x} . ${v-x} . "${u-x}" . "${v-x}" .; echoprintf '<%s> ' ${u=x} . ${v=x} . "${u=x}" . "${v=x}" .; echoprintf '<%s> ' ${u?x} . ${v?x} . "${u?x}" . "${v?x}" .; echoprintf '<%s> ' ${u#x} . ${v#x} . "${u#x}" . "${v#x}" .; echoprintf '<%s> ' ${u%x} . ${v%x} . "${u%x}" . "${v%x}" .; echoprintf '<%s> ' ${u:+x} . ${v:+x} . "${u:+x}" . "${v:+x}" .; echoprintf '<%s> ' ${u:-x} . ${v:-x} . "${u:-x}" . "${v:-x}" .; echoprintf '<%s> ' ${u:=x} . ${v:=x} . "${u:=x}" . "${v:=x}" .; echoprintf '<%s> ' ${u:?x} . ${v:?x} . "${u:?x}" . "${v:?x}" .; echo# these are invalid substitution operators#printf '<%s> ' ${u:#x} . ${v:#x} . "${u:#x}" . "${v:#x}" .; echo#printf '<%s> ' ${u:%x} . ${v:%x} . "${u:%x}" . "${v:%x}" .; echounset fooset -o posixrecho "${IFS+'bar}"recho "foo ${IFS+'bar} baz"recho ${IFS+'}'z}recho "${IFS+'}'z}": ${TMPDIR:=/var/tmp}rm -f $TMPDIR/shcp ${THIS_SH} $TMPDIR/shTHIS_SH=$TMPDIR/sh ${THIS_SH} ./posixexp1.sub || echo "sh posixexp1.sub: test $? failed"${THIS_SH} ./posixexp1.sub || echo "bash posixexp1.sub: test $? failed"THIS_SH=$TMPDIR/sh ${THIS_SH} ./posixexp2.sub || echo "sh posixexp2.sub: test $? failed"rm -f $TMPDIR/sh# this will be an errorfoo=barecho "${foo:-"a}"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -