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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!