I have a certain program that doesn't work right unless I run it as sudo. I don't mind having to type in my password, but I'd like to get out of the whole process of opening command line and typing "sudo ./"+script name. If you create a script that runs as sudo and click it, it just fails due to permissions. Is there a way to do this more quickly?
Mac – How to run a script or app as sudo with a click
macsudo
Related Question
- MacOS – cannot run sudo
- MacOS – Help me reset the terminal after sudo command mistake
- How to run sudo command from standard account
- Mac – How to specify shutdown time with “sudo shutdown”
- Grant non-admin sudo privilege, but with `~` being his own home~
- MacOS – Cannot Run Sudo After Mac Sierra Upgrade
- How to run `hping` without `sudo`
- Closing Terminal window does not kill script run with sudo
Best Answer
Run
sudo visudo
(orEDITOR=nano sudo visudo
) and add a line like this:Then create a
.command
file that runs/usr/bin/myscript
:Or if for example you want to run
sudo purge
without having to enter a password, addto sudoers.