tips:使用eval
例如:
#!/bin/bash
news=publish_time
var=news
# 要获取到publish_time
publish_time=`eval echo '$'"$var"`
echo $publish_time
tips:使用eval
例如:
#!/bin/bash
news=publish_time
var=news
# 要获取到publish_time
publish_time=`eval echo '$'"$var"`
echo $publish_time