Re: newbie - Remove blank lines

Jens Herden <[email protected]>
Newsgroups gmane.comp.kde.devel.quanta.user
Organization http://www.kdewebdev.org
Message-ID <[email protected]>
On Tuesday 02 October 2007, Alan Richmond wrote:
> On Tuesday 02 October 2007 09:35:19 am Jens Herden wrote:
> > > sed -i '/^$/d' yourFile.php
> >
> > Should this be:
> >
> > 	sed -e '/^$/d' yourFile.php
> >
> > ?
>
> No, -i tells sed to replace the old file with the editted one.  I even
> tested it before I posted and everything.  :)

Oh yes, you are right. I should not trust my memories but look into the man 
page first. :-(

But if you do it your way you have the problem that sed is reading from the 
file on the disk and writing to the disk again. If you want to use sed more 
efficiently with Quanta you better use is as a filter, reading from stdin and 
writing to stdout. This way Quanta can pipe the content of the current editor 
through it and would not work with the file on the disk.

> Checking --help for -e tells me it's for adding an external script to
> execution and takes a filename for an arg.

But this _is_ wrong ;-) If you want to give an external file you would use -f 
and -e is to give the expression as argument directly.

Jens

_______________________________________________
Quanta mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/quanta
signature.asc (application/pgp-signature, 194 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4-svn0 (GNU/Linux)

iD8DBQBHA2kmkYmIVB8IV+ARAjjhAKCMydQ1f/mhlE+d1umEBDiWdwPUBQCfWXR4
TsgboBeBLhL3VNo6yOCzP4w=
=htJF
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.