Linux有command可以加總文字檔內的數字嗎? - LinuxMadame · 2010-11-04Table of ContentsPostCommentsRelated Posts 例如有個ASCII file如下 1.4 3.14 5 ...... 有沒有command可以直接算出加總等於9.54的? 因為sort可以用 -n 去排大小 所以想知道有沒有這種命令 感謝! -- 你不知道你身上背負著多少責任…對吧?  ̄ ̄ ̄ -- LinuxAll CommentsSierra Rose2010-11-05expr可以做四則運算 但要自己寫script去讀每一行Michael2010-11-09所以必須用shell script嗎?Daniel2010-11-12cat file|awk 'BEGIN{sum=0;} {sum+=$0;} END{print sum;}'Kumar2010-11-15wow!! 感謝樓上!!!Related Posts修改常駐列圖示Squid 的 refresh_pattern 語法問題16位元碼如何轉成ASCII?有人使用Ubuntu 10.10有傳出災情嗎??Macbuntu+GEMAN
All Comments