My scripting abilities are limited. I'm trying to learn. I am grateful for any ideas and help.
I have a group of files (file1.num, file2.num, etc.) that have numbers in them that I need to add and send the total for each individual file to a particular line in another file (file1.num.total, file2.num.total, etc.).
To get the total of the numbers in one of the files, I use this:
typeset -i i
i=0
while read -r j
do
i=i+j
done < file1.num
echo $1 > file1.num.total
How can I script it so I can have all the *.num files processed at the same time?
I have a group of files (file1.num, file2.num, etc.) that have numbers in them that I need to add and send the total for each individual file to a particular line in another file (file1.num.total, file2.num.total, etc.).
To get the total of the numbers in one of the files, I use this:
typeset -i i
i=0
while read -r j
do
i=i+j
done < file1.num
echo $1 > file1.num.total
How can I script it so I can have all the *.num files processed at the same time?