[Bug 10906] /usr/bin/env: endless loop if VAR=ASSIGN present
vda.linux at googlemail.com
Fri Mar 30 21:17:02 UTC 2018
On Thu, Mar 29, 2018 at 11:18 PM, <bugzilla at busybox.net> wrote:
> --- Comment #2 from Steffen Nurpmeso <steffen at sdaoden.eu> ---
> |This construct does not do what you expect.
> Ok, but i think it is still a problem that this loops with 100%
> percent CPU usage, endlessly.
> |Everything after #! goes into argv:
> |argv='ABRA=KADABRA sh'
> |and argv is script's name. Thus, it won't work with any implementaion of
> Isn't that a pity, what a terrible restriction, it would be so
> nice to use. (At least perl has this -x ... "#!perl" mechanism so
> that no wrapper is needed at least there.)
> And, not all env(1):
> ?0[steffen at devon shared]$ ./t.sh
> hoho KADABRA haha
> ?0[steffen at devon shared]$ cat t.sh
> #!/usr/bin/env ABRA=KADABRA sh
> echo hoho $ABRA haha
> ?0[steffen at devon shared]$ strings /usr/bin/env
> usage: env [-i] [name=value ...] [utility [argument ...]]
> $FreeBSD: src/usr.bin/env/env.c,v 1.11 2002/09/04 23:28:59 dwmalone Exp $
It's not about _env_. It's how _kernel_ handles this form of sha-bang.
More information about the busybox-cvs