【发布时间】:2013-05-25 02:22:15
【问题描述】:
我正在尝试让 sed 更新 bash 脚本中的变量。这是我正在尝试做的一个简化示例。
myword="this is a test"
echo $myword
this is a test
换个工作测试
$myword | sed 's/a test/working'
echo $myword
this is working
【问题讨论】:
-
试试 myword = cat $myword | sed ...
-
@AmirAfghani 你没有
cat变量-你echo他们...... -
twalberg,我还没喝咖啡;)
标签: bash variables replace sed