home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / unix / question / 15905 < prev    next >
Encoding:
Text File  |  1993-01-24  |  906 b   |  23 lines

  1. Newsgroups: comp.unix.questions
  2. 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
  3. From: mark@mark-one.inet-uk.co.uk (Mark Powell)
  4. Subject: How to add a list of numbers?
  5. Message-ID: <1993Jan24.120619.5072@mark-one.inet-uk.co.uk>
  6. Organization: Mark-One Public Access UNIX (+44 942 273926)
  7. Date: Sun, 24 Jan 1993 12:06:19 GMT
  8. Lines: 13
  9.  
  10. What is the best (least CPU time) to addup a list of ASCII numbers?
  11. eg you've just used cut to extract a list of file sizes from a ls -l
  12. listing and now want to add all the numbers together. Is there some
  13. utility that will do this?
  14. All I can see is to write a for loop to add each number in turn to a
  15. total, using expr.
  16. Thanks in advance.
  17.  
  18. -- 
  19. Mark Powell
  20.  
  21. Mark-One Public Access UNIX, Manchester, UK     BBS:    +44 942 273926
  22. UniBoard, *the* UNIX BBS, UK distribution site    Voice:    +44 942 714317
  23.