On Thursday 22 December 2005 00:04, Mikhail Teterin wrote: > I'd like a sed string, that will remove both the carriage returns and the > blanks at eol in one go. Perl appears to recognize the \r character and > DTRT: > > perl -p -e 's,[ \r]+$,,' < in > out > > What's the sed's equivalent? Thanks!
I thought only bash could do it, but I was wrong: a=$'s/[ \r]\{1,\}$//' sed "$a" the shell will expand $'\r' to errr \r and you can use as an one-liner var=value sed "$var" HTH, Nikos > > -mi > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to > "[EMAIL PROTECTED]" _______________________________________________ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"