• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Scripting a command to unix with sudo fun
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Scripting a command to unix with sudo fun


  • Subject: Scripting a command to unix with sudo fun
  • From: "David B. Peterson" <email@hidden>
  • Date: Fri, 15 Mar 2002 11:18:48 -0800

You can pass your password to sudo on stdin:

-S The -S (stdin) option causes sudo to read the password
from standard input instead of the terminal device.


so your script becomes:
tell application "Terminal"
activate
do script with command "echo myrootpasswd | sudo /System/Library/Frameworks/Carbon.framework/Versions/A/Support/LaunchCFMApp/Applications/Utils-Network/RumpusServer/Rumpus2.1Carbon "
end tell

Of course, you will probably want to do a 'sudo -K' first, to make sure it asks for a password (because it caches the passwd.)

do script with command "sudo -K && echo myrootpasswd | sudo /System/Library/Frameworks/Carbon.framework/Versions/A/Support/LaunchCFMApp/Applications/Utils-Network/RumpusServer/Rumpus2.1Carbon "

-Dave
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: RE: Password for dialog boxes - Thanks
  • Next by Date: No result
  • Previous by thread: Re: Getting a PID and killing a process (Was: Re: Scripting a command to unix..)
  • Next by thread: The Ones & Oh's of Logic
  • Index(es):
    • Date
    • Thread