获取错误:
(standard_in) 1: syntax error
运行以下脚本时:
#!/bin/bash
while read line
do time=$(echo $line|awk '{print $10}'|awk -F"=" '{print $2}')
if (( $(echo "$time > 100" | bc -l) ))
then echo $line
fi
done < ping.txt
ping.txt 文件包含如下行:
2018-08-15 13:45:54: 64 bytes from server.my.local (192.168.1.117): icmp_seq=7163 ttl=62 time=327 ms
基本上我试图找到时间 > 100 毫秒的所有行
最佳答案
关于linux - (标准输入) 1 : syntax error when bc within if,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51963095/