Glad you enjoyed the podcast and found it useful.

I didn't want this episode to go too deep into Bash, so I deliberately drew the line at dealing with indirect references and positional parameters. I was almost ready to cover indirection, but finally decided not to. Perhaps next time!

Your example of 'echo ${!$#}' failing is, I assume, because Bash performs just one scan for parameter substitutions. In this case, even if it performed two passes, this would resolve to 'echo ${!3}' which returns nothing.

I tried this:

$ set -v -- joy pain bliss; myargc=$#; eval echo \${!$#}

which does do two passes. First time the backslash is dropped and  $# returns 3 and second time Bash executes  'echo ${!3}' which does nothing. It's not illegal this time, but is counter-intuitive.

This one returns 'bliss':

$ set -v -- joy pain bliss; myargc=$#; ind=myargc; eval echo \${!$ind}

Bash is pretty cool!