标签: linux shell
我想做这样的操作
for i in `ls -1 /var/tmp` do zip /var/backup/$i.zip $i done
现在我想将/var/tmp dir更改为像这样的变量
/var/tmp
backup_dir=/var/tmp for i in `ls -1 ${backup_dir}` do zip /var/backup/$i.zip $i done
但是,这是一个错误的方法?怎么做?