Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Is the "right solution" to use `tee`? I saw that once, and it seemed like we should be able to do better -- as if, had `tee` not been in the standard we wouldn't have any way to do it...


Alternatively: sudo sh -c 'echo 0 > /sys/foo'


You can spawn a shell as root but this is hardly any more elegant.

sudo sh -c "echo 'foo' >> /etc/file"


I use tee, but you can always do the ugly sudo sh -c "..." thing.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: