I pass a string as an argument to a shell script. and the shell script should tell me if the passed argument is a variable
something like this
if [ ! -z ${$1} ] ; then
echo yes! $1 is a variable and its value is ${$1}
fi
but this gives me bad substitution err..
I definitely know i'm missing something.. help me out!
Eg usage:
$ myscript.sh HOME
yes! HOME is a variable and its value is /home/raj