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

Re: bash exorcism experiment ('bug' 762923 & 763012)



>> Array variables practically imply arithmetic evaluation, amd this is
>a
>> shell feature which is rather difficult to use correctly because
>> compatibility with other shell encourages both recursive evaluation
>> and access to the full shell language in a few corners.

I think the idea here was not "use correctly" as in "yielding the result you expect" but as in "guard against wreaking havoc":

foo='x[$(rm -rf /)]'
echo $(( foo ))

Guess when the array index is evaluated? Now mind that it could be user-provided.

-nik


Reply to: