• 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
Re: How to Run a "sudo" Terminal Command
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to Run a "sudo" Terminal Command


  • Subject: Re: How to Run a "sudo" Terminal Command
  • From: Yvan KOENIG <email@hidden>
  • Date: Sat, 12 Dec 2015 18:13:14 +0100


Le 2015/12/12 à 17:57, S. J. Cunningham <email@hidden> a écrit :

On Dec 12, 2015, at 7:20 AM, Dave wrote:

Hi All,

I’d like to execute a Shell Script with the “sudo” command, e.g.

sudo some-command

If I do this from the terminal it prompts me for my password how can I do this from an AppleScript, ideally I’d like the Standard Mac OS Password Dialog to appear…..

Is this possible?

All the Best
Dave

I'd like to know how to do it _without_ the dialog.  Something like:

do shell script xxx with user ID yyy and password zzz

Steve

Hello Steve

The dictionary of Standard Additions is often a valuable source of infos.
Here it is which state :
do shell script v : Execute a shell script using the ‘sh’ shell
do shell script text : the shell script to execute.
[as type class] : the desired type of result; default is text (UTF-8)
[administrator privileges boolean] : execute the command as the administrator
[user name text] : use this administrator account to avoid a password dialog (If this parameter is specified, the “password” parameter must also be specified.)
[password text] : use this administrator password to avoid a password dialog
[with prompt text] : the prompt to be displayed in the password dialog when the name and password are not specified or are incorrect
[altering line endings boolean] : change all line endings to Mac-style and trim a trailing one (default true)
→ text : the command output
For answers to commonly asked questions about do shell script, see Technical Note TN2065.


Yvan KOENIG running El Capitan 10.11.2 in French (VALLAURIS, France) samedi 12 décembre 2015 18:12:59


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >How to Run a "sudo" Terminal Command (From: Dave <email@hidden>)
 >Re: How to Run a "sudo" Terminal Command (From: "S. J. Cunningham" <email@hidden>)

  • Prev by Date: Re: AS Library Question
  • Next by Date: Re: How to Run a "sudo" Terminal Command
  • Previous by thread: Re: How to Run a "sudo" Terminal Command
  • Next by thread: Re: How to Run a "sudo" Terminal Command
  • Index(es):
    • Date
    • Thread