cat file
$VAR
cat script开发者_如何学Go
#!/bin/bash
CONTENT=$(<file)
echo $CONTENT
./script
$VAR
I'd like to get the variable's actual value, not "$VAR". How to get a weaker quoting? Many thanks!
This should do it:
CONTENT=$(eval echo -e `<file`)
精彩评论