Thank you, Greg, for the quick, helpful response. > Your best bet is to store the > index in a variable instead of trying to deal with multiple levels > of quoting in the same argument.
In the script where this problem arose, the index is indeed stored in a variable, and I tried various ways of quoting it. > imadev:~$ i="a'b" > imadev:~$ unset 'foo[$i]' However, I did not try that way, because -- according to the bash documentation -- it shouldn't work. Single quotes should prevent the expansion of $i. Even knowing now that this does work, I can't find where this exception to single-quote behavior is documented.