OSX - Sudo a command without entering the password

https://superuser.com/questions/67765/sudo-with-password-in-one-command-line

$echo <password> | sudo -S <command>