02-18-06 03:40 AM
On 2006-02-15, Adam wrote:
> Hi,
> In a shell, Bourne in my case, what tools would I use, can how would I
> use them to add up a set of numbers in a file.
> For example if I had a file holding...
>
> filename
> ------------
> 10
> 15
> 7
> 2
>
> How would I derive the total of those numbers, 34?
See my answer in comp.unix.questions. (The first solution is POSIX
rather than Bourne.)
--
Chris F.A. Johnson, author | <http://cfaj.freeshell.org>
Shell Scripting Recipes: | My code in this post, if any,
A Problem-Solution Approach | is released under the
2005, Apress | GNU General Public Licence
[ Post a follow-up to this message ]
|