Curious bash evaluation

Rodolfo Alcazar Portillo nospaze at gmail.com
Mon Dec 27 16:05:44 UTC 2010


Hello. See this:

# A="echo 'hi'"

# echo $($A)
'hi'

# echo 'hi'
hi

Does anyone understand why does the first command 
evals the echo but echoes the simple quotes? 

Is there any dark shopt option which makes it run correctly?

Thanks...
----------------------------------------------
Rodolfo Alcazar Portillo - nospaze at gmail.com
otbits.blogspot.com / counter.li.org: #367962
----------------------------------------------
# unzip; strip; touch; finger; grep; mount; fsck; more; yes; fsck; fsck;
fsck; umount; sleep




More information about the users mailing list