LoginSignup
9
5

More than 5 years have passed since last update.

bashで小数点比較

Posted at
decimal_if.sh
#! /bin/bash

num1=4.8
num2=3.6

if [ `echo "$num1 > $num2" | bc` == 1 ]; then
    echo "$num1 > $num2"
fi
9
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
5