I'd like to execute a script in ~
with a command that needs elevated rights. This example should suffice:
cp /etc/AAA/* /etc/BBB/
Now if that copying script would be started in, say, scripty.sh
with the +x
bit set, it wouldn't work.
This is actually about exchanging the xbacklight -set $brightness_night
-commands like ddcutil setvcp 10 70
in a script to control screen brightness.
How can I script this to avoid entering my password each time the brightness is changed? Or would this be the easiest way still?
sudo
not sufficient? – Dec 29 '17 at 15:44sudo script
. – user4556274 Dec 29 '17 at 15:45sudo cp …
. – Dec 29 '17 at 15:45