substituindo uma string no lugar da variável no shell
Eu passo uma string como argumento para um script de shell. e o shell script deve me dizer se o argumento passado é uma variável
algo assi
if [ ! -z ${$1} ] ; then
echo yes! $1 is a variable and its value is ${$1}
fi
mas isso me dá uma substituição ruim err ..
Eu definitivamente sei que estou perdendo alguma coisa .. me ajude!
Eg uso:
$ myscript.sh HOME
yes! HOME is a variable and its value is /home/raj