lvstr0='*[?&*]*' ... lvstr2='*['\''`~<>:#$?&* -]*' lvstr=\$lvstr2
$ lvstrn=`eval echo $lvstr` $ svf lvstr lvstr='$lvstr2' lvstr0='*[?&*]*' lvstr2='*['\''`~<>:#$?&* -]*' lvstrn='*['\''`~<>:#$?&* -]*'
a=123 b='The interpolated value for \$a is $a'
$ c=`eval echo $b`; svs c c=The interpolated value for $a is 123
These are no good:
$ c="$b"; svs c c=$a
$ eval c="$b" bash: want: command not found
$ v=PATH
$ echo \$"$v" $PATH
$ eval echo \$"$v" /export/home/tong/bin:/export/home/tong/local/bin:/usr/lib:/shared/local/bin:/usr/local/bin:/usr/shared/bin:/opt/gnu/bin:/bin:/shared/bin:/shared/sbin:/etc:/shared/ucb:/shared/ccs/bin:/shared/openwin/bin:/shared/dt/bin:/export/home/tong/bin/pf:/export/home/tong/bin/tcltk:.
b=a a='ls -l'
$ echo \$"$b" $a $ eval \$"$b" total 256 -rw-r----- 1 tong tong 8262 Aug 17 17:09 Makefile [...]
— long list pwd
$ c=`eval echo "b de-refered to \\$b, which is " \\$"$b" `; svs c c=b de-refered to a, which is ls -l
These are no good:
$ c=`eval echo 'b de-refered to \\$b, which is \\$"$b"' `; svs c c=b de-refered to $b, which is $a
$ c=`eval echo 'b de-refered to \\$b, which is \\\\$"$b"' `; svs c c=b de-refered to $b, which is \a
$ c=`eval echo 'b de-refered to \\$b, which is \\\\\\$"$b"' `; svs c c=b de-refered to $b, which is \$a