Can I set up my own sub-environment?

Ralf Friedl Ralf.Friedl at online.de
Tue Feb 8 11:20:40 UTC 2011


Sven-Göran Bergh wrote:
> Anyway, I do no think it is consistent:
>
> $ f1() { for z in $(seq 1 3); do : y=$z; done }
> $ echo "y=$y, z=$z"
> y=, z=
> $ f1
> $ echo "y=$y, z=$z"
> y=, z=3

It works the same in bash and busybox ash.

The problem is that you expect the text after the colon to do something.
Try this instead:

f1() { for z in $(seq 1 3); do y=$z; done }

Ralf Friedl


More information about the busybox mailing list