Quote:
Originally Posted by cq04cw
the second form b=`eval echo \\$$_var` which i can't read it.
pass1: eval echo \$aa ## \\ -> \ (as manpage explained), $_var -> aa
pass2: eval it ? echo \$aa -> $aa , $aa is output of echo , b=$aa, but the result is b=AAAA ($aa's val).
how to understand the second form ?
|
The manpage states "a `\' followed by any of `$', ``', or `\' is stripped", so the first strip is for \\, leaving \$...but since \$ is in the list, too, the second \ is stripped as well, leaving $$_var, which is $aa, which evals to AAAA.
PHP Code:
$ set -x
$ `eval echo \\$$`
+ eval echo $$ # BOTH \'s are stripped!
+ echo 31889
+ 31889
/bin/ksh: 31889: not found