-
All replies
-
Helpful answers
-
-
Oct 11, 2014 5:01 PM in response to VikingOSXby BobHarris,Modifying my script to use the ShellShock patched /bin/bash and lower case -a I get the following results:
/bin/bash --version
GNU bash, version 3.2.53(1)-release (x86_64-apple-darwin13)
Copyright (C) 2007 Free Software Foundation, Inc.
/bin/bash not_so_associative_array_example.sh # run the example
xyz
0
xyz
xyz
It should be:
def xyz
abc_key qrs_key
def
xyz
I think it just treated foo as index zero in your example, and in my example "abc_key" and "qrs_key" were also treated as zero, so the last thing stored in array element 0 was the value returned.
As much as I have used AWK,...
It is always nice to find someone else that likes awk. So many people do not appreciate awk, and at most use it just to pick a field out of a string, or worse they insist on doing "cat file | awk '...'" instead of "awk '...' file". Anyway, I do like to find people that like awk.
