I need to programmatically open a shell script in a Terminal window and run it with administrator privileges. I'm using osascript as it displays a convenient prompt for an admin login/password.
I'm currently using this :
osascript -e 'do shell script "open -a Terminal \"'"$appDir"'\"" with administrator privileges'
The trouble is, even after entering the credentials in the OS X prompt, the newly opened script will beg for a password at the first sudo command.
How do I pass the admin credentials to the opened script?