[CentOS] perl code to remove newlines

cpolish at surewest.net cpolish at surewest.net
Thu Dec 30 19:44:33 UTC 2010


John Doe wrote:
 
> $ cat $FILE | tr "\n" " " | sed 's/ *></>\n</g'

I was yearning for someone to chime with that!
sed is clearly the best & most straightforward way to do
this task.

I can't help myself - there's a "useless use of cat":

$ < $FILE tr "\n" " " | sed 's/ *></>\n</g'

http://www.partmaps.org/era/unix/award.html#uucaletter
-- 
"Pedantic, I?" -- Alexei Sayle




More information about the CentOS mailing list