Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
変数が「1.5」以上かどうかを確認するために、簡単な計算を実行しようとしていますが、[: 2.41: integer expression expected
[: 2.41: integer expression expected
コード:
reSum=$(expr "scale=1;555/230" | bc) if [ $reSum -ge "1.5" ]; then ... fi
シェルスクリプトで浮動小数点比較を行うにはどうすればよいですか?
if echo 555 230 | awk '{exit $1/$2 >= 1.5 ? 0 : 1}' then # ... fi