I would like to get a single value from output.txt file, and run different other bash commands based on the returned value pattern;
cat output.txt
enter code here
SAMPLE FILE DATA
{ "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 script file
while read line
do
if [[ $line =~ 'tenki-deploy' ]]
then
echo "$line"
fi
done