Basic scripting is done

This commit is contained in:
Hizenberg469
2024-11-30 11:20:46 +05:30
parent 1ede16f3c4
commit 04859194ac
8 changed files with 369 additions and 1 deletions

25
function.sh Normal file
View File

@@ -0,0 +1,25 @@
#!/bin/bash
function addition {
local FIRST=$1
local SECOND=$2
let RESULT=FIRST+SECOND
echo "Result is: $RESULT"
let FIRST++
let SECOND++
return $RESULT
}
#do the addition of two numbers
echo -n "Enter first number: "
read FIRST
echo -n "Enter second number: "
read SECOND
addition $FIRST $SECOND
echo "RETURN: $?"
echo "Printing variable:"
echo "FIRST: $FIRST"
echo "SECOND: $SECOND"