Re: AppleScript-Users Digest, Vol 11, Issue 347
Re: AppleScript-Users Digest, Vol 11, Issue 347
- Subject: Re: AppleScript-Users Digest, Vol 11, Issue 347
- From: Omar K N <email@hidden>
- Date: Wed, 17 Sep 2014 21:28:50 +0200
@Jim Weisbin
ok, then it’s better to leave the system asking for a password as is.
>As others have answered, the proper way to do it is to call the shell script "with administrator privileges”. However, if there is some reason that you really cannot do that (I can’t imagine why, but I don’t know)
The reason was to avoid getting the password dialogue each and every time.
/ okn
Date: Wed, 17 Sep 2014 12:21:03 -0400 From: Jim Weisbin <email@hidden> To: email@hidden Subject: Re: sudo permission in a script Message-ID: <email@hidden" style="font-family: LucidaGrande; font-size: 18px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">email@hidden> Content-Type: text/plain; charset="windows-1252"
Omar K N <email@hidden> wrote:
The shell script is part of an AppleScript, so as it is now I can’t use it because I don’t know how to write the sudo in it: If I write sudo do shell script "echo " & (quoted form of ExportList) & "|tr -d \"\\t\"|/usr/local/bin/dayone/dayone new" the process will stop.
As others have answered, the proper way to do it is to call the shell script "with administrator privileges”.
However, if there is some reason that you really cannot do that (I can’t imagine why, but I don’t know), then there is a way that you can set your system to allow sudo without a password for a particular user. This is NOT recommended for security reasons, but it’s worth knowing about:
locate the sudoers file (/etc/sudoers) open it with visudo (this requires knowing the vi editing program). If you open it with any other editor, you will mess up it’s permissions, so don’t.
<username> ALL=NOPASSWORD: ALL
Jim Weisbin | C.T.O. | human | 138 Fifth Avenue | 3rd Floor | New York, NY | 10011 | (212) 352-0211 | (917) 375-2272 | Los Angeles Office | 2046 Broadway | Santa Monica, CA | 90404 | (310) 264-0211 telephone | www.humanworldwide.com
|
_______________________________________________
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