sysctl: Clarify -w usage
From reading of the help/manpage it would appear that the
-w parameter is necessary to actually write sysctl data.
variable=value To set a key, use the form variable=value where variable is the key and value is the value to set it to. If the value contains quotes or characters which are parsed by the shell, you may need to enclose the value in double quotes. This requires the -w parameter to use.
But just mere occurrence of the
= character in any positional argument is taken to mean it's expected to be of the
variable=name form and so to set the
variable to the
value , hence following are equivalent:
sysctl var=value sysctl -w var=value
There is a difference though:
sysctl var1=value var2 sysctl -w var1=value var2
Whereas in the first case read/write mode is selected by each of argument's format (that is presence of
=) and hence it will write the
value to the
var1 and then output the
var2, in the second case all arguments are for writing strictly (because of the
-w) and so error will be raised while processing the
I think as it is the manual page is a bit misleading. Especially with the
This requires the -w parameter to use. statement which is untrue. I suggest to drop it entirely, and changing the
-w parameter to read something like:
-w, --write Use this option when all arguments prescribe a key to be set.