Scripting su or sudo on OS X
Scripting su or sudo on OS X
- Subject: Scripting su or sudo on OS X
- From: Gary Beberman <email@hidden>
- Date: Thu, 6 Dec 2001 16:24:21 -0800
I know that to call Unix commands in OS X I can use Terminal or OSX
PowerAddOns OSAX. These appear great for scripting individual
commands to execute.
But, what if the command requires interaction. Suppose I need to su
to a different ID or sudo a command and I get asked for a password.
How do I provide a reply? I have naively tried variations on:
tell application "Terminal"
tell window 1
do script with command "su root"
tell me to delay 5
do script somePW & return
end tell
end tell
and gotten nowhere.
Thanks,
Gary