Last active
May 22, 2018 01:41
-
-
Save dharshan/77e5a63b4e62a2f4add6fe914e03d9f8 to your computer and use it in GitHub Desktop.
shell script to add two numbers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Above line to specify which shell to be used to execute the program | |
echo "Enter first Number" # echo used to print the message to screen | |
read first_number # read and store the input from terminal | |
echo "enter second Number" | |
read second_number | |
sum=`expr $first_number + $second_number` # things insed the backtick ` are evaluate or executed | |
echo "$first_number + $second_number = $sum" # $ to specify arguments | |
# give execution permission to file before running the program like bellow | |
# chmod +x add1.sh | |
# run the program by ./add1.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment