Actions
Bug #5979
closedDocument usage of line replacement in Enforce a file content technique
Status:
Released
Priority:
1 (highest)
Assignee:
Category:
Techniques
Target version:
Pull Request:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Name check:
Fix check:
Regression:
Description
Situation:
In file /etc/sysctl.conf:
node 1 has: kernel.shmmax = 1234
node 2 has: kernel.shmmax = 4321
node 3 has: kernel.shmmax = 2143
Actually the value could be anything. And I don't (want to) know what is is.
Now I want to accomplish this:
node 1 has: kernel.shmmax = 5678
node 2 has: kernel.shmmax = 5678
node 3 has: kernel.shmmax = 5678
What I need here is one simple regex that matches:
All lines in sysctl.conf, which start with "kernel.shmmax", followed by a space, followed by an = sign, followed by a space, followed by a number I don't know.
Please provide documentation on how to do this.
Actions