On 17-11-16 16:43, Pavel A wrote:
> Dear experts,
>
> We have a strange problem with ash script: the shell silently exits while
> executing a script. It is likely caused by a "let" command.
> Anyone seen similar behavior? How to debug it?
>
> Busybox version is 1.22.1 (this is what it prints out, not sure about
> configuration and build details).
> The same script works well on busybox 1.16.0
> Unfortunately this does not reproduce on small example.
>
> The failing place in the script looks like;
> Somefunc() {
> local v
> echo "this prints"
> let "v = $foo & 0x000FFF "
I guess you have a 'set -e' somewhere in your script?
let returns the value it computed, so if $foo is different from 0, it will
return non-0. This causes the shell to exit.
It's POSIX behaviour.
Regards,
Arnout
> echo "this does not print"
> }
>
> We checked that the script does not contain weird unprintable characters and
> other obvious things. Just plain ascii.
>
> Best regards,
> pavel_a
>
>
> _______________________________________________
> busybox mailing list
> [email protected]
> http://lists.busybox.net/mailman/listinfo/busybox
>
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox