| Summary: | Setting a variable to the result of a script does not run the script | ||
|---|---|---|---|
| Product: | Busybox | Reporter: | Sean Walton <swalton> |
| Component: | Standard Compliance | Assignee: | unassigned |
| Status: | NEW --- | ||
| Severity: | major | CC: | busybox-cvs |
| Priority: | P5 | ||
| Version: | 1.20.x | ||
| Target Milestone: | --- | ||
| Hardware: | Other | ||
| OS: | Linux | ||
| Host: | Target: | ||
| Build: | |||
Failed to reproduce it. Which version of busybox do you have? |
Code: export RAND_SEED=123456789 export RANDOM=${RAND_SEED} randomize() { RANDOM=$(( ${RANDOM} * ${RAND_SEED} % 4000000000 )) echo "**************${RANDOM}" >2 echo ${RANDOM} } If I run this by hand I get "unique" results, but if I x=$(randomize) 'randomize' is executed at most one time. Every subsequent call yields the previously derived value. Is this normal 'ash' behavior? This is being run on an i.MX6 ARM processor with a home-brew Linux distro.