Adrien wrote:
> Hi,

<snip>

> Also, on my computer, I have the following behaviour:
>     11:44 ~ % sudo echo 0 > /proc/sys/kernel/randomize_va_space
>     zsh: permission denied: /proc/sys/kernel/randomize_va_space
>     r...@jarjar:~# echo 0 > /proc/sys/kernel/randomize_va_space
>     r...@jarjar:~#
> I can't use sudo to write to most files in /proc or /sys: I have to log in
> as root ('su -' does the job just fine).

The redirection (> /proc/sys...) is not part of the sudo invocation, it's a 
separate instruction to the *shell* to redirect output of the previous part of 
the command to a file and so it runs with *your* uid. There are two ways to 
achieve what you're after - one verbose one described in the sudo man page 
(essentially you pass the whole command line to sudo quoted) or the easier way:

echo 0| sudo tee /proc/sys/kernel/randomize_va_space

You can add > /dev/null if tee's outputting of the 0 to stdout is for some 
reason annoying.


David

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Reply via email to