echo "HELLO"
read name
echo "Welcome $name"
read x
read y
echo $(($x+$y))
bc
command to evaluate expression
read exp
printf "%.3f" $(echo $exp | bc -l)
read X
read Y
if (($X > $Y))
then
echo "X is greater than Y"
elif (($X < $Y))
then
echo "X is less than Y"
else
echo "X is equal to Y"
fi
read a
read b
read c
if [[ $a -eq $b && $b -eq $c ]]; then
echo "EQUILATERAL";
elif [[ $a -eq $b || $a -eq $c || $b -eq $c ]]; then
echo "ISOSCELES";
else
echo "SCALENE";
fi
#!/bin/bash
for i in {1..99};
do
if (($i % 2 == 1))
then
echo $i
fi
done
read n
sum=0
for (( i=1 ; i<=$n ; i++ ))
do
read a
let "sum+=$a"
done
printf "%.3f" $(echo $sum/$n | bc -l)
Return whole line if pattern is matched
read char; echo -e "YES\nNO\n" | grep -i $char