Introduction
You may have the need to make multiple changes in a file and can be done so with one sed command.
Procedure
The search and replace functions can be joined in a single quote set to make changes like the following example. This was from a request to set all notification events to high with a value of 1. This function searches for "2" and replaces those with "1" and also searches for "3" and also replaces those with "1".
sed -i 's/\"2\"/\"1\"/g; s/\"3\"/\"1\"/g' /var/cpanel/icontact_event_importance.json
Comments
0 comments
Article is closed for comments.