小编Man*_*v G的帖子

shell中`set -x`的Python等价物是什么?

请建议Python命令,它等同set -x于shell脚本.

有没有办法打印/记录Python执行的每个源文件行?

python debugging shell

31
推荐指数
2
解决办法
6708
查看次数

在Linux中回收bin脚本

在我的生产服务器中,有人执行了rm -rf,我的重要文件被永久删除.所以,我想有一个回收站,所以如果用户这样做rm,文件将转移到RecycleBin而不是从服务器删除.我已经为它制作了以下脚本.但是我在执行时遇到了一些错误.

alias rm='/root/remove.sh'

#rm test_file 现在,在键入rm命令时将触发脚本

#!/bin/bash
dir=$(pwd)
mv $dir/$1 /root/Recyclebin

当上面的脚本被触发时,我收到以下错误.

mv:cannot move '/root/test_file' to '/root/Recyclebin': Not a directory

现在,请建议有没有其他方法来制作除此之外的回收站概念或请帮助解决错误.提前致谢.

我正在使用CentOS 5.6

linux bash recycle-bin

3
推荐指数
1
解决办法
3997
查看次数

标签 统计

bash ×1

debugging ×1

linux ×1

python ×1

recycle-bin ×1

shell ×1