On Sun, 20 May 2012, Polytropon wrote:

Regarding the use of "sed": I'm not sure if it's possible
to do something like

        % sed -i '.bak' 's/\r//g' config.php

because I assume (not tested!) that it's not possible to
put in escape sequences like that. But try for yourself
and surprise me. :-)

A traditional way of stripping CRs is with col(1):

  % col < config.php > config.php-lfonly

sed almost goes out of its way to make the most useful escapes unavailable, or at least unavailable where you need them. Perl makes it all available and can be used as a sed replacement:

  % perl -i.bak -pe 's/\r//g' config.php

(Tested.)
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

Reply via email to