make variable substitution work in command substitution
Merge pull request #130 from calfzhou/var-sub

make variable substitution work in command substitution