We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Linux Shell
- Bash
- More on Conditionals
- Discussions
More on Conditionals
More on Conditionals
Sort by
recency
|
328 Discussions
|
Please Login in order to post a comment
Basic approach
read X read Y read Z if ((Y && Z && Z )); then echo "EQUILATERAL" elif ((Y || Z || Z )); then echo "ISOSCELES" else echo "SCALENE" fi
Simple Bash Code
if [ y ] && [ z ]; then echo "EQUILATERAL" elif [ y ] || [ z ] || [ z ]; then echo "ISOSCELES" else echo "SCALENE" fi
read X read Y read Z
if [[ Y && Z ]]; then
echo "EQUILATERAL"
elif [ Y ] || [ Z ] || [ Y ]; then
echo "ISOSCELES" elif [[ X != Y && Y != Z && Z != X ]]; then echo "SCALENE" fi
read x read y read z
if [ y ] && [ z ] then echo "EQUILATERAL" elif [ y ] && [ z ] then echo "SCALENE" else echo "ISOSCELES" fi