Comparing Numbers

  • + 1 comment
    #!/bin/bash
    
    read -p "Please enter two numbers: " X Y
    if [ $X -gt $Y ]; then
        echo "X is greater than Y"
    elif [ $X -lt $Y ]; then
        echo "X is less than Y"
    else
        echo "X is equal to Y"
    fi