📄 update
字号:
#!/bin/sh# make sure --update works as advertisedif test "$VERBOSE" = yes; then set -x cp --version mv --versionfi. $srcdir/../envvar-check. $srcdir/../lang-defaultpwd=`pwd`tmp=mv-update.$$trap 'status=$?; cd $pwd; rm -rf $tmp && exit $status' 0trap '(exit $?); exit' 1 2 13 15framework_failure=0mkdir $tmp || framework_failure=1cd $tmp || framework_failure=1echo old > old || framework_failure=1touch -d yesterday old || framework_failure=1echo new > new || framework_failure=1if test $framework_failure = 1; then echo 'failure in testing framework' 1>&2 (exit 1); exitfifail=0for cp_or_mv in cp mv; do # This is a no-op. $cp_or_mv --update old new || fail=1 case "`cat new`" in new) ;; *) fail=1 ;; esac case "`cat old`" in old) ;; *) fail=1 ;; esacdone# This will actually perform the rename.mv --update new old || fail=1test -f new && fail=1case "`cat old`" in new) ;; *) fail=1 ;; esac# Restore initial conditions.echo old > old || fail=1touch -d yesterday old || fail=1echo new > new || fail=1# This will actually perform the copy.cp --update new old || fail=1case "`cat old`" in new) ;; *) fail=1 ;; esaccase "`cat new`" in new) ;; *) fail=1 ;; esac(exit $fail); exit
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -