Why can't I use echo $1 > /sys/class/backlight/acpi_video0/brightness in a simple bash script?
It gives me the error: echo: write error: Invalid argument.
|
Try I bet the shell is expanding $1 and thus echo thinks it is receiving a bunch of arguments, rather than a string. |
|||
|
|
|
You should check what the actual value of At a glance, it appears that it accepts an integer in the range 0 to 8 (for me at least). |
|||
|
|
function brightness { bright=$1; sudo su -c 'echo "$bright" > /sys/class/backlight/acpi_video0/brightness'; }too, but I still haven't figured it out. – seafangs Nov 2 '12 at 12:15