ca4e9c2e3fd4a7285b607d0a5674fdfbf364b793
compute/data-munging.md
| ... | ... | @@ -4,7 +4,7 @@ |
| 4 | 4 | `cat list | paste -s -d+ | bc` |
| 5 | 5 | |
| 6 | 6 | ### Remove all but one trailing newlines |
| 7 | -`sed -e :a -e '/^\n*$/{$d;N;};/\n$/ba' file` |
|
| 7 | +`sed -i -e :a -e '/^\n*$/{$d;N;};/\n$/ba' file` |
|
| 8 | 8 | |
| 9 | 9 | ### Make sure a file has a trailing newline |
| 10 | 10 | `tail -c1 file | read -r _ || echo >> file` |