replace carriage returns - the final solution

Jay R. Ashworth jra at baylink.com
Wed Jul 7 09:42:01 PDT 2004


On Wed, Jul 07, 2004 at 12:09:45PM -0400, Kenneth Brody wrote:
> "Jay R. Ashworth" wrote:
> > That's easier to read, certainly... but it's probably more efficient to
> > do it as a pipeline:
> > 
> > cat $1 |
> >   tr -d '\000' |
> >   sed 's/~//g' |
> >   tr -d '\r' |
> >   tr -d '\n' |
> >   cat >/appl/servefx/shared/working/$1
> 
> Can't you combine all the "tr -d"s?
> 
>    tr -d '\000\r\n' | sed 's/~//g' >/appl/servefx/shared/working/$1

Yeah; I was trying to do it with multiple -d options, which doesn't
work; overlooked that.  Actually, you can probably do it with multiple
-e options to sed.

Cheers,
-- jra
-- 
Jay R. Ashworth                                                jra at baylink.com
Designer                          Baylink                             RFC 2100
Ashworth & Associates        The Things I Think                        '87 e24
St Petersburg FL USA      http://baylink.pitas.com             +1 727 647 1274

	"You know: I'm a fan of photosynthesis as much as the next guy,
	but if God merely wanted us to smell the flowers, he wouldn't 
	have invented a 3GHz microprocessor and a 3D graphics board."
					-- Luke Girardi


More information about the Filepro-list mailing list