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 · 1 comment
Open

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

neutronscott opened this issue Apr 26, 2024 · 1 comment

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.

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

1 participant