On 2 January 2014 23:03:02 Ron Yorston <[email protected]> wrote:
Mike Frysinger wrote:
>correct. busybox knows nothing of SHLVL. it's just another env var to
busybox. so if you set/export/whatever it, then busybox will pass it along
unmodified.
In 1.22.0 BusyBox ash does (conditionally) know about SHLVL:
#if ENABLE_ASH_BASH_COMPAT
p = lookupvar("SHLVL");
setvar2("SHLVL", utoa(p ? atoi(p) + 1 : 1));
#endif
This is supposed to make it compatible with bash. bash does this:
[rmy@vulcan ~]$ unset SHLVL
[rmy@vulcan ~]$ sh
sh-4.2$ echo $SHLVL
1
sh-4.2$ sh
sh-4.2$ echo $SHLVL
2
sh-4.2$
Because it doesn't export SHLVL BusyBox ash behaves differently:
[rmy@f14vm busybox]$ unset SHLVL
[rmy@f14vm busybox]$ ./sh
~/busybox $ echo $SHLVL
1
~/busybox $ ./sh
~/busybox $ echo $SHLVL
1
~/busybox $
Did I forget to export it when it was not exported yet?
Patches welcome..
Thanks,
Sent with AquaMail for Android
http://www.aqua-mail.com
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox