【发布时间】:2013-12-12 23:40:06
【问题描述】:
使用 bash 我想知道如何找到以文本开头的单词的所有实例,将其存储为变量并打印出来。
例如,如果这是我的文件
test.conf
$temp_test
test
$1234_$temp
$temp_234
我的输出如下:
$temp_test
$temp_234
谁能告诉我这怎么可能?这是迄今为止我能到达的最接近的位置。
while read NAME
do
echo "$NAME"
done < test.conf
【问题讨论】:
标签: linux bash shell ubuntu debian