4 ms·
"sudo sysctl -w ..." works as expected, but "sudo echo ...> /proc/..." doesn't, since only the echo and not the redirection happens as root.
by bdarnell 15y ago
"sudo sysctl -w ..." works as expected, but "sudo echo ...> /proc/..." doesn't, since only the echo and not the redirection happens as root.
- usetee 15y agoThat depends on what you expect, doesn't it? At any rate, you can easily do something like echo 1 | sudo tee /proc/foo This has the added bonus that you can replace "echo 1" with a complex script that may not be safe to run as root.