News for hackers. Stuff that matters.
Re:What's the one Linux command you wish you knew years ago? by 1010010101 on Sunday November 20, 2011 @04:42PM (#3259095)
Note: "cmds" is one or more s commands. For other commands, if it's a big file, I will just pipe through less (still no temp file) and then save the buffer (to overwrite the original file), instead of using this hack.

A hack for in-place editing, for old school sed (no -i):

sedi(){ case $# in 0) echo usage: sedi cmds file;; 2) sed -an ' '"$1"'; H; $!d; g; w '"$2"'' $2;; esac; }

There are no comments on this comment yet.