[CS-FSLUG] An easy way to remove blank lines?
Jukka
jukka.ylonen at gmail.com
Mon Sep 12 09:35:54 CDT 2005
2005/9/12, Josiah Ritchie <jritchie at bible.edu>:
>
> This takes into account the possibility that there is 0 or more
> whitespace characters between the start and end of the line.
>
> sed '/^\s*$/d' < index.html > index.html
>
> It worked for me. WARNING! It will overwrite your file. backup before
> you issue this command. Take off the > index.html to have it only output
> the changes to the screen and not the file.
>
> JSR/
Hi Josiah!
Your warning was important - for some reason it was not possible to
use same name for both input and output. Every one of the scripts
produced blank files until I renamed output file to something else
than input! But these are fine scripts! Thank you!
Blessings,
Jukka
More information about the Christiansource
mailing list