我如何在每 5000 个段落上更改 wput 的上传目录?我的代码有什么问题?
仅作记录;我需要无限循环,我想 24 小时 365 天运行这个脚本!每 5000 个段落在目录中增加一个数字,例如incoming1-infinite
此致
豪格
#!/bin/bash
for (( ; ; ))
do
no=1
while [ $no -le 5000 ]
do
perl job.pl false false 1
cd comp
for fname in *.jpg;
do
mv -i "$fname" ${RANDOM}${RANDOM}.jpg
done
for fname in *.jpg;
do
mv "$fname" $(echo "$fname" | sha1sum | cut -f1 -d' ').jpg
done
if [ $no = '5000' ]
then
echo $no
echo $n
n=$(( n+1 )) # <-- this one not do what i need :-(
else
wput *.jpg ftp://user:pass@ip:port/incoming$n/ # <-- here is the important part 2, i need it to change one directory higher every 5000 passage for example; incoming1 until infinite
rm -rf *.jpg
cd ..
fi
no=`expr $no + 1`
done
done