Timeline for Bash command to sum a column of numbers
Current License: CC BY-SA 4.0
8 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Oct 11 at 13:13 | history | edited | Benjamin Loison | CC BY-SA 4.0 |
Add a missing space
|
| Dec 19, 2024 at 13:45 | comment | added | Tomáš Záluský | Upvoting, though the expression in @gbgnv's comment under ghostdog74's answer is better solution for empty stream. I needed to return 0 when stream is empty. | |
| May 24, 2024 at 9:37 | comment | added | Marcin Szydelski | command | paste -s -d'+' - | bc works also on AIX. :) | |
| Jul 11, 2022 at 6:39 | comment | added | Roux |
On my system (Ubuntu 20.04) the command with nawk is about twice faster than with gawk (default awk), and about x3 faster than the winner paste|bc command.. Tested with the 1..49999998 file.
|
|
| Jul 25, 2021 at 17:22 | comment | added | Samuel Prevost |
command | paste -s -d'+' - | bc that one works on mac OS too
|
|
| Apr 7, 2020 at 19:31 | comment | added | Xavier Prudent | This ones works with mac OS 10.15 | |
| Feb 18, 2017 at 5:21 | history | edited | codeforester | CC BY-SA 3.0 |
added 4 characters in body
|
| Mar 25, 2014 at 9:26 | history | answered | minhas23 | CC BY-SA 3.0 |