Question: Write a script named sum.sh to print given numbers sum of all digits. The shell accepts one integer argument as a parameter. Your program must
Write a script named sum.sh to print given numbers sum of all digits. The shell accepts one integer argument as a parameter. Your program must check number of argument is one. If number of argument is not one, your program must display error message and exit. For example)
./sum.sh 345 Sum of digit for number is 12
./sum.sh You need pass one numerical argument
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
