Question: #!/bin/bash #initializing result variable to zero res=0 #reading each values from the runtime parameters for i in $* do # if any of the values

#!/bin/bash

#initializing result variable to zero res=0

#reading each values from the runtime parameters for i in $* do # if any of the values are negative, then changing it to positive by multiplying by one if [ "$i" -lt 0 ] then why it is giving me 0 instead of 58

help me

i=$(expr $i \* -1); fi #adding each values one by one to result variabe res=$(expr $i + $res); done #displaying the result echo $res;

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!