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

📄 sh.testcases

📁 手机嵌入式Linux下可用的busybox源码
💻 TESTCASES
字号:
# try running this with bash, ksh, ash, and hush.# simple quoting rules.echo a  becho "a  b"echo a "" becho a '' becho hello?echo "hello?"echo t* helloecho t\* hello# quick and painless exit for lashif false; then true; exit; fi# fairly simple command substitutionecho `echo -e foo\\\necho bar`echo THIS IS A TEST >foocat $(echo FOO | tr 'A-Z' 'a-z')cat foo | tr 'A-Z' 'a-z'cat $(echo FOO | tr 'A-Z' 'a-z') | tr 'A-Z' 'a-z'cat foo | if true;  then tr 'A-Z' 'a-z'; else echo bar1; ficat foo | if false; then tr 'A-Z' 'a-z'; else echo bar2; fiif true;  then tr 'A-Z' 'a-z'; else echo bar3; fi <fooif false; then tr 'A-Z' 'a-z'; else echo bar4; fi <fooif true || false; then echo foo; else echo bar5; fiif true && false; then echo bar6; else echo foo; fi# basic distinction between local and env variablesunset FOOFOO=bar env | grep FOOecho "but not here: $FOO"FOO=barenv | grep FOOecho "yes, here: $FOO"FOO=echo a $FOO becho "a $FOO b"# not quite so basic variables.  Credit to Matt Kraai.unset FOOFOO=barexport FOOenv | grep FOOunset FOOexport FOO=barFOO=bazenv | grep FOO# interaction between environment variables and if/then and subshellsFOO=defaultif true; then FOO=new; fiecho $FOOFOO=default(FOO=bogus)echo $FOO# make sure we can duplicate file descriptors properlyecho replacement >foo 2>&1cat foocat doesnt_exist >foo 2>&1tr 'a-z' 'A-Z' <foo# fairly simple example of hush expanding variables too earlyunset TMPrm -f fishTMP=fish && >$TMPls fish# ash, lash, and hush do not create wish; bash and ksh do.# Thanks to Tapani Tarvainen <tt@mit.jyu.fi> for this stress test.unset TMPrm -f wishTMP=wish >$TMPls wish# The following example shows that hush's parser is# not _really_ Bourne compatibleecho "echo Hello World" >"a=b"unset achmod a+x "a=b"PATH=$PATH:."a=b"echo $a# assuming the shell wasn't too buggy, clean up the messrm -f a=b wish fish foo

⌨️ 快捷键说明

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