[Bug 3091] Nonportable tool usage in scripts
Chris Rees
utisoft at gmail.com
Wed Apr 6 19:33:13 UTC 2011
On 5 April 2011 16:43, Rich Felker <dalias at aerifal.cx> wrote:
> On Thu, Feb 10, 2011 at 09:33:32AM +0100, Denys Vlasenko wrote:
>> > While BusyBox supports it, the -r option to sed is nonstandard, so
>> > little is improved. If you want to go this route, use:
>> >
>> > sed -ne 's/\(^#\{0,1\} \{0,1\}CONFIG_.*\)$/"\1\\n"/gp' "$config"
>> >
>> > But really I don't care which solution is applied; I'd just like to
>> > see _something_ correct done so I don't have to keep patching around
>> > the issue.
>>
>> Current git should be fixed already. Ping me if it isn't.
>
> It's not fixed in 1.18.4, which was released much later...
>
> Rich
>
That's because there are two instances of it in that file.
Patch at [1] makes it work fine for FreeBSD grep... it looks less
specific but it should have the same effect.
Just putting a * in instead of \? makes it less likely to break, and
the only possible side effect is that:
# # CONFIG_SOMETHING
could match by accident-- how likely is that??
Chris
[1] http://www.bayofrum.net/~crees/patches/busybox-grep-compat.diff
More information about the busybox
mailing list