$ v=value $ p=v $ echo ${!p} value $ (echo ${!p}) value $ (p2=$p;echo ${!p2}) value $ function f() { p2=$1;echo ${!p2}; } $ f p v