Possible Duplicate:Redirecting stdout to a file you don't have write permission on I am creating a script to change the brightness of my laptop. I discovered that I can do this using echo 1000  > /sys/class/backlight/intel_backlight/brightnessfor example. But I must to do this as root, not with sudo command. Well, I created the file /usr/bin/brilho containing echo $1  > /sys/class/backlight/intel_backlight/brightnessand now I can execute it with brilho 1000. But the problem is the permission. This does not work with sudo brilho 1000 neither brilho 100. Again I have to change to root.So, I would like to know how to improve this to facilitate my job.Regards and thanks.
Script with root permission
permissions;scripting;brightness
To allow arbitrary user to change brightness, you could setup sudo, invoke visudo to launch the editor, and put the following line at the end:username ALL=NOPASSWD: /usr/bin/tee /sys/class/backlight/intel_backlight/brightnessAnd the script will be:echo $value | sudo tee /sys/class/backlight/intel_backlight/brightnessWhich will no longer ask your password 