[slightly OT] using sudo -S via shell

Ken Ray kray at sonsothunder.com
Sat Nov 19 14:01:52 EST 2005


On 11/19/05 9:02 AM, "Ton Kuypers" <tkuypers at pandora.be> wrote:

> - How do I send the password in one line with the sudo command,
> because I can't seem to get this working from within the Terminal app.

Here's how... in this case I'm using sudo to kill a process (the id of which
is in tPID):

    put "#!/bin/sh" & cr into tScript
    put "pw="&tPassword & cr into tScript
    put "echo $pw | sudo -S kill -9" && tPID & cr after tScript
    get shell(tScript)


HTH,

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com




More information about the use-livecode mailing list