我的目的是为了将板子上当前目录下的heapprof-voip.0001.heap~heapprof-voip.0096.heap
文件,全部发送到主机FTP/tmp/183heap目录下
代码如下:
#!/bin/sh
let i=96
#name="heapprof-voip.0001.heap"
firstName="heapprof-voip.00"
lastName=".heap"
for i in {1..96}
do
let j=i-10
if [ $j -ge 0 ]; then
name="${firstName}${i}${lastName}"
else
name="${firstName}0${i}${lastName}"
fi
echo "$name"
#curl -T $name ftp://192.168.0.195/tmp/183heap
done
错误如下:
[root@(none) shm]# ./get.sh
./get.sh: let: line 18: arithmetic syntax error
sh: 0: unknown operand
heapprof-voip.000{1..96}.heap
[root@(none) shm]#