Problems with '\r' handling by 'sed' applet (BusyBox versions up to 1.18.4)
utisoft at gmail.com
Mon May 2 08:57:24 UTC 2011
On 2 May 2011 07:00, Tomasz Czapiewski <xeros at irc.pl> wrote:
> Busybox 'sed' handles '\r' in replacements differently than real 'sed'.
> Examples from BusyBox sed:
> # echo 'something' | busybox sed 's/something/something\r/g'
> # echo 'rambo' | busybox sed 's/\r//g'
> # echo -e 'rambo\r and \rrambo' | busybox sed 's/\r//g'
> While outputs of the same using real 'sed':
> # echo 'something' | sed 's/something/something\r/g'
> # echo 'rambo' | sed 's/\r//g'
> # echo -e 'rambo\r and \rrambo' | sed 's/\r//g'
> rambo and rambo
> This make some problems with my scripts portability.
> None of BusyBox 'sed' applet parameters, like '-r' help to solve it.
That's because it's a GNUism; BSD sed doesn't accept this either.
GNU sed is not 'real sed', there is no 'real sed'.
What are you trying to do?
More information about the busybox