Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

You can't use sed -i on /etc/sysctl.d/*.conf #11908

Open
neutronscott opened this issue Apr 26, 2024 · 3 comments
Open

You can't use sed -i on /etc/sysctl.d/*.conf #11908

neutronscott opened this issue Apr 26, 2024 · 3 comments

Comments

@neutronscott
Copy link

This clobbers the symlink and ruins everything!

@neutronscott
Copy link
Author

neutronscott commented Apr 26, 2024

The whole thing is a mess. You use grep to find a pattern, then see if it was found, and then a while read loop to read it back in, just to have sed add a hash mark. sed can search for things too. the whole thing probably equivalent to sed 's/^\s*kernel\.core_pattern.*/# &/' "$f" but add a --follow-symlinks in there I guess.

@marcusburghardt
Copy link
Member

@neutronscott would you like to propose a PR to improve this? I would be happy to review it.

@neutronscott
Copy link
Author

I can try that. I was at work and unable to. Also, sorry about the tone, work is like that sometimes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants