User talk:Pranavg1890

From ArchWiki
Latest comment: 17 July 2014 by Alad in topic Backlight

Backlight

Why did you do this the second time? As indicated in the reason for reverting your first edit, see Help:Reading#Regular user or root for why it is wrong to add sh -c .... -- Lahwaacz (talk) 09:27, 17 July 2014 (UTC)Reply[reply]

My guess is he used sudo to execute the command, in which case the sh -c is needed; best would be to use a here document:
# tee /sys/class/backlight/acpi_video0/brightness <<< 5
Edited accordingly. --Alad (talk) 09:46, 17 July 2014 (UTC)Reply[reply]
I've reread Help:Reading#Regular user or root and it does mention the case of redirection. Perhaps tee could be mentioned there, or in the sudo article. --Alad (talk) 09:53, 17 July 2014 (UTC)Reply[reply]
Oh Very Sorry I was not aware of the rules. But in my case that original line was not working with root also...i was getting permission error.And also i used sudo command.Sorry for inconvenience...Pranavg1890 (talk) 10:09, 17 July 2014 (UTC)Reply[reply]
Just run sudo -s to enter a root shell and then execute the original command, there won't be any errors.
@Alad: note that tee is only a workaround for the intended action involving root shell. It is not generic enough to fully replace it, it solves only the problem with redirection and there are other problems, e.g. glob expansion in inaccessible paths etc.
-- Lahwaacz (talk) 10:30, 17 July 2014 (UTC)Reply[reply]
Fair enough, closing. --Alad (talk) 10:57, 17 July 2014 (UTC)Reply[reply]