More on Conditionals

  • + 0 comments
    read X
    read Y
    read Z
    
    if [[ "$X" -eq "$Y" && "$Y" -eq "$Z" ]]; then
        echo "EQUILATERAL"
    elif [[ ( "$X" -eq "$Y" && "$Y" -ne "$Z" )  || ( "$X" -eq "$Z" && "$X" -ne "$Y" ) || ( "$Y" -eq "$Z" && "$Y" -ne "$X" )  ]]; then
        echo "ISOSCELES"
    else
        echo "SCALENE"
    fi