I\'m having a problem with a shell script (POSIX shell under HP-UX, FWIW). I have a function called print_arg into which I\'m passing the name of a parameter as $1. Given
You could use eval, though using direct indirection as suggested by SiegeX is probably nicer if you can use bash.
eval
bash
#!/bin/sh foo=bar print_arg () { arg=$1 eval argval=\"\$$arg\" echo "$argval" } print_arg foo