[Bug 7052] New: Setting a variable to the result of a script does not run the script

bugzilla at busybox.net bugzilla at busybox.net
Mon Apr 21 14:25:10 UTC 2014


https://bugs.busybox.net/show_bug.cgi?id=7052

           Summary: Setting a variable to the result of a script does not
                    run the script
           Product: Busybox
           Version: 1.20.x
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P5
         Component: Standard Compliance
        AssignedTo: unassigned at busybox.net
        ReportedBy: swalton at captioncall.com
                CC: busybox-cvs at busybox.net
   Estimated Hours: 0.0


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.

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the busybox-cvs mailing list