• 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: sudo permission in a script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sudo permission in a script


  • Subject: Re: sudo permission in a script
  • From: Jim Weisbin <email@hidden>
  • Date: Wed, 17 Sep 2014 12:21:03 -0400

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

  • Prev by Date: Re: sudo permission in a script
  • Next by Date: Re: sudo permission in a script
  • Previous by thread: Re: sudo permission in a script
  • Next by thread: Re: sudo permission in a script
  • Index(es):
    • Date
    • Thread