bash/ksh/scripting eval subshell quotes
- by jhon
Hi tehere,
I'm using ksh and have some little troubles, could you help me?
why does not this code run?
[root]$ CMD="ls -ltr"
[root]$ eval "W=$( $CMD )"
[root]$ ksh: ls -ltr: not found.
[root]$ echo $W
and this works fine:
[root]$ CMD="ls -ltr"
[root]$ eval 'W=$('$CMD')'
[root]$ echo $W
Thanks :-)