Reputation: 49
I have the following line in my .conf file
application.release = "4"
I'm trying change it to application.release = "4.$any_value"
with sed
Current pattern:
sed -c -i "s/\(application.release *= *\).*/\1\"$any_value\"/"
Could help me anybody?
Upvotes: 0
Views: 751
Reputation: 58351
This might work for you (GNU sed):
sed -i '/^application.release = "4"$/s/"$/.$any_value"/' file
If a line contains application.release = "4"
replace the last character with .$any_value"
Upvotes: 1
Reputation: 99084
Try adding one more backslash:
sed -c -i "s/\(application.release *= *\).*/\1\"\$app_version\"/"
Upvotes: 0