我想从output.txt文件中获取一个值,然后根据返回的值模式运行其他bash命令;
cat output.txt
enter code here
样品文件数据
{ "Topics":
[
{ "Name": "arn:aws:sns:us-west-2:123456789012:freezing-deploy-topic"},
{ "Name": "arn:aws:sns:us-west-2:123456789012:dense-deploy-topic" },
{ "Name": "arn:aws:sns:us-west-2:123456789012:tenki-deploy-topic" }
]
}
Shell脚本文件
while read line
do
if [[ $line =~ 'tenki-deploy' ]]
then
echo "$line"
fi
done