我試圖得到這個當「行」的格式爲### ###的工作數據的轉換浮點數整數通過文件讀取
示例行:
Query_time: 188.882
當前腳本:
#!/bin/bash
while read line; do
if [ $(echo "$line" | cut -d: -f2) -gt 180 ];
then
echo "Over 180"
else
echo "Under 180"
fi
done < test_file
錯誤,我得到:
./calculate: line 4: [: 180.39934: integer expression expected
我添加了錯誤輸出 – user3299633