Parameter expansion fails when assigning a local variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I've found a problem with expanding $@.
If I declare a local variable and assigns the expanded positional parameters:
        local v="$@"
It fails with something like:
        local: 20: \/: bad variable name

If I split declaration and assignment into two lines it will work:
        local v
        v="$@"

I've tried this on dash 0.5.5.1 and 0.5.3 and both fail in the same way.
I've also tried on bash and ash (Busybox) and both handles declaration and assignment on one line.

I'm attaching a small script that shows the problem.

Best regards,
Jesper Bengtsson

Attachment: dash-arg-bug.sh
Description: dash-arg-bug.sh


[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux