On Tuesday, May 08, 2012 08:55:26 PM Bill Gradwohl wrote:
> Is there a write up somewhere that explains what exactly -i does internally?
>
> Are variables declared -i stored in binary?
>
> Is there any advantage or disadvantage to using -i for speed, memory
efficiency, etc?
>
> Thank You
>
> --
> Bill Gradwohl
INTERNALLY? I believe they are stored in exactly the same way as any other
variable, they just get the -i attribute added as metadata. The ksh88 manpage
states that -i may be faster, but I believe in Bash it's actually slightly
slower, which makes sense because now all assignments are subject to an extra
evaluation step, and operators are modified such as the behavior of += in
several places.
Using -i can be an easy source of bugs and security problems, and adds a lot
of
quirks especially with arrays.
-- Dan Douglas
signature.asc Description: This is a digitally signed message part.