home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.questions
- Path: sparky!uunet!europa.asd.contel.com!howland.reston.ans.net!spool.mu.edu!agate!doc.ic.ac.uk!pipex!ibmpcug!jshark!mark-one!mark
- From: mark@mark-one.inet-uk.co.uk (Mark Powell)
- Subject: How to add a list of numbers?
- Message-ID: <1993Jan24.120619.5072@mark-one.inet-uk.co.uk>
- Organization: Mark-One Public Access UNIX (+44 942 273926)
- Date: Sun, 24 Jan 1993 12:06:19 GMT
- Lines: 13
-
- What is the best (least CPU time) to addup a list of ASCII numbers?
- eg you've just used cut to extract a list of file sizes from a ls -l
- listing and now want to add all the numbers together. Is there some
- utility that will do this?
- All I can see is to write a for loop to add each number in turn to a
- total, using expr.
- Thanks in advance.
-
- --
- Mark Powell
-
- Mark-One Public Access UNIX, Manchester, UK BBS: +44 942 273926
- UniBoard, *the* UNIX BBS, UK distribution site Voice: +44 942 714317
-