Re: do shell script "sudo -v"
Re: do shell script "sudo -v"
- Subject: Re: do shell script "sudo -v"
- From: Sean Elfstrom <email@hidden>
- Date: Fri, 14 Dec 2001 15:56:05 -0600
At 1:37 PM -0800 12/14/01, Timothy H. Kaiser, Ph.D. wrote:
>
I want to run a command that requires input using
>
>
do shell script
>
>
in particular I want to run sudo -v
>
>
set input to "sudo -v"
>
set theResult to do shell script input as string
>
>
sudo asks for a password.
>
>
So what i want to do is something like
>
>
set input to "sudo -v & return & "my_password" & return
>
>
but that does not work since (I assume) my_password is not
>
sent until sudo returns.
>
>
Any ideas?
You can pass in the password like so:
Shell "echo 'somePW' | sudo -S somecommand"
I wouldn't recommend using this method with scripting Terminal, because the password will be in plaintext in the title bar and the window, but it should work fine with OSX PowerAddOns or Kinder Shell.
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Sean Elfstrom email@hidden | ImagiQ
http://www.ImagiQ.com/
XO/Mac Wrangler PGP:0x716F29D6 | 2325 NW Military, Suite 103
Apple Product Professional O- | San Antonio, TX 78231
Apple Authorized Sales & Service | 210-377-3545 800-750-0787