- 论坛徽章:
- 0
|
回复 2# 网中淫
谢谢帮助,你的代码确实完成了我的要求。
不过我在man cp的时候发现了下面两段,看着样子是可以实现类似的功能,就是不知道如何实现。- --backup[=CONTROL]
- make a backup of each existing destination file
复制代码- The backup suffix is `~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX. The version control method may be selected via the
- --backup option or through the VERSION_CONTROL environment variable. Here are the values:
- none, off
- never make backups (even if --backup is given)
- numbered, t
- make numbered backups
- existing, nil
- numbered if numbered backups exist, simple otherwise
- simple, never
- always make simple backups
- As a special case, cp makes a backup of SOURCE when the force and backup options are given and SOURCE and DEST are the same name
- for an existing, regular file.
复制代码 |
|