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

📄 i-2

📁 实战Linux编程的原代码,希望对学驱动的人能有所帮助
💻
字号:
#!/bin/sh# Test both cp and mv for their behavior with -if and -fi# The standards (POSIX and SuS) dictate annoyingly inconsistent behavior.if test "$VERBOSE" = yes; then  set -x  mv --version  cp --versionfi. $srcdir/../envvar-check# Make sure we get English translations.. $srcdir/../lang-defaultPRIV_CHECK_ARG=require-non-root . $srcdir/../priv-checkpwd=`pwd`tmp=cp-mv-if-$$trap 'status=$?; cd $pwd; rm -rf $tmp && exit $status' 0trap 'exit $?' 1 2 13 15framework_failure=0mkdir $tmp || framework_failure=1cd $tmp || framework_failure=1for i in a b c d e f g h; do  echo $i > $i || framework_failure=1donechmod 0 b d f h || framework_failure=1echo y > y || framework_failure=1if test $framework_failure = 1; then  echo 'failure in testing framework'  exit 1fifail=0mv -if a b || fail=1mv -fi c d < y >/dev/null 2>&1 || fail=1# Before 4.0s, this would not prompt.cp -if e f < y > out 2>&1 || fail=1# Make sure out contains the prompt.case "`cat out`" in  "cp: overwrite \`f', overriding mode 0000?"*) ;;  *) fail=1 ;;esactest -f e || fail=1test -f f || fail=1cmp e f || fail=1cp -fi g h < y > out 2>&1 || fail=1test -f g || fail=1test -f h || fail=1cmp g h || fail=1exit $fail

⌨️ 快捷键说明

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