Problems with '\r' handling by 'sed' applet (BusyBox versions up to 1.18.4)

Chris Rees utisoft at gmail.com
Mon May 2 11:34:28 UTC 2011


On 2 May 2011 12:20, Tomasz Czapiewski <xeros at irc.pl> wrote:
> On Mon, 2 May 2011, Chris Rees wrote:
>
>> On 2 May 2011 07:00, Tomasz Czapiewski <xeros at irc.pl> wrote:
>>>
>>> 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?
>>
>
> Sorry about naming.

You're not the only one ;)

> I've get used to GNU tools and I'm comparing commands to GNU alternatives as
> I'm making and testing scripts on Linux.
> I've worked around the current code so it's not a problem for this script
> for now but I wanted to avoid simmilar problems in future.
> The script makes changes to xml files for binary app which uses carriage
> return in XML like on Windows.

You could always try using awk; it's more powerful and more likely to support
things. Sed is usually a can of worms portability-wise; see some
previous commits
to the BusyBox build scripts.

Maybe you should have a look at [1].

> So the target of BusyBox tools is to aim BSD compatibility, no GNU?

It's more about POSIX than BSD; the target of BusyBox tools is to remain
small for embedded systems; including every bloated option that GNU does
would defeat that object.

> Regards,
> Tomasz Czapiewski
>

[1] http://linux.dsplabs.com.au/rmnl-remove-new-line-characters-tr-awk-perl-sed-c-cpp-bash-python-xargs-ghc-ghci-haskell-sam-ssam-p65/


More information about the busybox mailing list