backup-1

来自「实战Linux编程的原代码,希望对学驱动的人能有所帮助」· 代码 · 共 25 行

TXT
25
字号
#!/bin/sh# Try to create a symlink with backup where the destination file exists# and the backup file name is a hard link to the destination file.# Based on a problem report from Jamie Lokier.if test "$VERBOSE" = yes; then  set -x  ln --versionfitrap "rm -rf a b b~" 0 1 2 3 15framework_failure=0touch a b || framework_failure=1if test $framework_failure = 1; then  echo 'failure in testing framework'  exit 1filn b b~ || fail=1ln -f --b=simple a b || fail=1exit $fail

⌨️ 快捷键说明

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