【发布时间】:2021-12-08 01:19:13
【问题描述】:
我需要一些帮助,我有一个脚本 (script.sh),内容如下:
#!/bin/bash
export name='toto'
file='file.txt'
content=$(cat "file.txt")
echo "$content"
file.txt 内容一些文本: 我是$name
现在当我运行我的脚本 (script.sh) 时,变量 $name 未被解释,我得到如下结果: 我是 $name 我想要这样的结果:I am toto
【问题讨论】: