Tyleo-Dev-ShellScripting-Ol.../SH_TRAINING/training4.sh

43 lines
1 KiB
Bash
Raw Normal View History

2024-02-18 21:29:57 +00:00
#!/usr/bin/env bash
echo "
----------------------
The additions script
----------------------
"
echo
echo "Enter two value, the script will calculate them."
echo
echo -n "First : "
read first
echo -n "$first+"
read second
echo "$first+$second=`echo $(($first+$second))`"
echo "$first plus $second equal to `echo $(($first+$second))`"
echo
echo "Now, the same thing with substracting :"
echo -n "First : "
read first
echo -n "$first-"
read second
echo "$first-$second=`echo $(($first-$second))`"
echo "$first substracted to $second equal to `echo $(($first-$second))`"
echo
echo "Now, with dividing :"
echo
echo -n "First : "
read first
echo -n "$first/"
read second
echo "$first/$second=`echo $(($first/$second))`"
echo "$first divided $second equal to `echo $(($first/$second))`"
echo
echo "Now, with... Multiplication !"
echo
echo -n "First : "
read first
echo -n "$first*"
read second
echo "$first*$second=`echo $(($first*$second))`"
echo "$first multiplicated by $second equal to `echo $(($first*$second))`"
echo
echo "End of script"