[wellylug] vi / ex question

jumbophut jumbophut at gmail.com
Tue Dec 7 16:20:13 NZDT 2004


On Tue, 7 Dec 2004 16:12:57 +1300, Andrew Childs wrote:
> sed -i -e 's/^$//' filename
> 
> The problem with this is that (as you point out) sed works on each line seperately. This means that it will match every empty line and replace it with an empty line. I'm not sure of the way around this.
> 

Me neither, at least not with s///.  If you use /d as in my last
e-mail, it proceeds straight from deleting the pattern space to
reading the next line, with no printing in between.  Likewise -n
suppresses printing of non-matching lines.

Anyway, it looks like John has his solution.

-- 
Tony (echo 'spend!,pocket awide' | sed 'y/acdeikospntw!, /l at omcgtjuba.phi/')




More information about the wellylug mailing list