what's an equivalent for the following Perl one-liner?

Don Hinton don.hinton at vanderbilt.edu
Thu Dec 22 13:37:01 PST 2005


On Thursday 22 December 2005 13:52, Mikhail Teterin wrote:
> > Try col(1) or tr(1) to remove the carriage return and then sed to remove
> > the spaces.
>
> Well, yes, but that's a two-stage process. A shame to go through the whole
> file twice just because our tools aren't good enough.

How about this:

sed 's/ *[[:cntrl:]]$//' 

hth...
don
>
> 	-mi
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to
> "freebsd-questions-unsubscribe at freebsd.org"

-- 
Don Hinton <don.hinton at vanderbilt.edu>                    615.480.5667
ISIS, Vanderbilt University
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20051222/aa8cd8c3/attachment.bin


More information about the freebsd-questions mailing list