[Solved] Shell Script – Adding memory functionality
You should store the result in a variable like this: result=$((operand1+operand2)) Then your first if statement can check if this variable has a value, and if it does, skip the read and use it instead. if [[ $result == “” ]]; then echo Enter operand1 value: read operand1 else operand1=$result echo “Operand 1 is: $result” … Read more