我编写了一个脚本,该脚本将备份到已安装的磁盘中/mount/data/
,我不想在复制其他文件夹时复制该文件夹,我proc
也sys
不想复制
for dir in `ls /`; do
if [ $dir != "mount" -o $dir != "proc" -o $dir != "sys" ]; then
sh /home/bin/safecopy $dir
fi
done
但条件被忽略
$dir != "mount" -o $dir != "proc" -o $dir != "sys"
并safecopy
尝试复制mount
,proc
然后sys
……为什么?
但是当我这样做时
for dir in `ls /`; do
if [ $dir != "mount" ]; then
if [ $dir != "proc" ]; then
if [ $dir != "sys" ]; then
sh /home/bin/safecopy $dir
fi
fi
fi
done
有用!