Replies: 2 comments 10 replies
-
I fail to see why this is a problem. To process If we added another expansion pass in the processing of subscripts itself, we'd get a double evaluation problem – and a code injection vulnerability when untrusted values are used as array subscripts. |
Beta Was this translation helpful? Give feedback.
7 replies
-
Ugh. Awful. I have solutions in mind that benefit from other nice properties of ksh conducive to making this work cleanly. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
This is just one contrived scenario but this class of problem crops up all over the place. It generally assumes the subscript is a raw arithmetic expression for indexed arrays and a literal string in the case of associative arrays. I've run into variations on this problem countless times and sometimes it's impossible to work around.
I believe ksh has always been like this but I haven't seen any discussion about it. This seems like a generic problem with the way variables are handled.
Beta Was this translation helpful? Give feedback.
All reactions