There were a couple occasions where I want to send commands to "files" in these locations:
- To increase/decrease the brightness level on a Compaq Presario laptop, but issuing "echo 20 > /proc/acpi/video/.../brightness"
- To make a Dell Inspiron 1525 laptop suspend to ram, by issuing "echo mem > /sys/power/state"
If I try one of these just like that, I get a "Permission denied". Yet, even if I use "sudo echo mem > /sys/power/state", I still get the same error.
But if I put this line of code in a bash script then run it with sudo, it works.
Is that a bug? Why can't I sudo it from the terminal?