Hi,
I use the following code to extrapolate bash string. I'm wondering if
this might not be robust in some corner cases. Does anybody have any
better solution? Thanks.
~/linux/bashrc/src/extrapbashstr/main$ cat main.sh
#!/usr/bin/env bash
function extrapbashstr {
echo $(eval echo "$1")
}
extrapbashstr '~'
x=blah
extrapbashstr '/tmp/ $x'
~/linux/bashrc/src/extrapbashstr/main$ ./main.sh
/home/<username>
/tmp/ blah
--
Regards,
Peng