I have configuration file named "mymy.conf" with following content
Code:
"subject" : "My HTTP alert on $device.node_id"
The following script should display the value of "subject" but it displays nothing/null.
Code:
#! /bin/bash
curSubj=`grep -oP '"subject" : "\K.*(?=\$device.node_id)' .mymy.conf`
echo "$curSubj"
When i run the same syntax in terminal i.e.
grep -oP '"subject" : "\K.*(?=\$device.node_id)' it displays the result as
My HTTP alert on but when i run the script it does not display the result.
Is there any difference? Help Please.
Thanks