为什么执行awk命令在终端能打印出字符,语句放到脚本中就不能打印字符只打印出一个空格了?
脚本如下:#!/bin/bashfps=(40.4741.0740.839.825.2625.11)count=0for((i==0;i<${#fps[@]};i++))...
脚本如下:
#!/bin/bash
fps=(40.47 41.07 40.83 9.82 5.26 25.11)
count=0
for((i==0;i<${#fps[@]};i++))
do
echo ${fps[i]}
echo $fps |awk "BEGIN{a=${fps[i]};print a<"24" ? "lost":"get";}"
# echo $fps|awk "BEGIN{${fps[i]}>= 24"?"OK":"error";}"
# let count=count+1
done
执行结果:
[root@node72 home]# ./111.sh
40.47
41.07
40.83
9.82
5.26
25.11 展开
#!/bin/bash
fps=(40.47 41.07 40.83 9.82 5.26 25.11)
count=0
for((i==0;i<${#fps[@]};i++))
do
echo ${fps[i]}
echo $fps |awk "BEGIN{a=${fps[i]};print a<"24" ? "lost":"get";}"
# echo $fps|awk "BEGIN{${fps[i]}>= 24"?"OK":"error";}"
# let count=count+1
done
执行结果:
[root@node72 home]# ./111.sh
40.47
41.07
40.83
9.82
5.26
25.11 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询