Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
repsilat
on Feb 7, 2016
|
parent
|
context
|
favorite
| on:
Maybe: run a command, see what it does to your fil...
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...
yrro
on Feb 7, 2016
|
next
[–]
Alternatively: sudo sh -c 'echo 0 > /sys/foo'
therein
on Feb 7, 2016
|
prev
|
next
[–]
You can spawn a shell as root but this is hardly any more elegant.
sudo sh -c "echo 'foo' >> /etc/file"
cyphar
on Feb 7, 2016
|
prev
[–]
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: