bash/ksh/scripting eval subshell quotes

Posted by jhon on Stack Overflow See other posts from Stack Overflow or by jhon
Published on 2010-05-03T19:46:01Z Indexed on 2010/05/03 19:48 UTC
Read the original article Hit count: 284

Filed under:
|
|
|
|

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 :-)

© Stack Overflow or respective owner

Related posts about bash

Related posts about ksh