|
shell script question
I am using ksh.
There is a report having amounts in the following format,
34343.67-
2343.45
23434.89-
I want to sum up all the amounts. For this I first need to find out if there is a minus sign at the end and prefix it before summing up. How to achieve this?
I thought of using an array to store the values and then sum up the amounts using a while loop. But don't have any clue as how to first convert the amounts to below format,
-34343.67
2343.45
-23434.89
Any help is appreciated.
Thanks!
|