From 82233f26ce3f63767b0208cf9cb27d93fffe9e80 Mon Sep 17 00:00:00 2001 From: Nial <48334675+nmcc1212@users.noreply.github.com> Date: Fri, 1 Mar 2024 11:38:13 +0000 Subject: [PATCH] Add bash script to calculate the sum of two numbers --- bashExercise/2.sh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 bashExercise/2.sh diff --git a/bashExercise/2.sh b/bashExercise/2.sh new file mode 100644 index 0000000..6ad460a --- /dev/null +++ b/bashExercise/2.sh @@ -0,0 +1,7 @@ + +echo "Enter the first number: " +read num1 +echo "Enter the second number: " +read num2 +result=$(echo "$num1 + $num2" | bc) +echo "The sum of the two numbers is: $result" \ No newline at end of file