into-self-3
来自「实战Linux编程的原代码,希望对学驱动的人能有所帮助」· 代码 · 共 41 行
TXT
41 行
#!/bin/sh# move a directory into itself, with a twistif test "$VERBOSE" = yes; then set -x mv --versionfidir1=is3-dir1dir2=is3-dir2framework_failure=0rm -rf $dir1 $dir2 || framework_failure=1mkdir $dir1 $dir2 || framework_failure=1if test $framework_failure = 1; then echo 'failure in testing framework' exit 1fi# Make sure we get English translations.. $srcdir/../lang-default# This mv command should exit nonzero.mv $dir1 $dir2 $dir2 > out 2>&1 && fail=1sed \ -e "s,mv:,XXX:,g" \ -e "s,$dir2,ZZZ,g" \ out > out2cat > exp <<\EOFXXX: cannot move `ZZZ' to a subdirectory of itself, `ZZZ/ZZZ'EOFcmp out2 exp || fail=1rm -fr out out2 exp $dir1 $dir2exit $fail
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?