• 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: do shell script and redirection fun!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: do shell script and redirection fun!


  • Subject: Re: do shell script and redirection fun!
  • From: garbanzito <email@hidden>
  • Date: Fri, 9 Aug 2002 16:20:23 -0600

at 2002 08 09, 14:29 -0700, they whom i call email@hidden wrote:
do shell script "echo password | sudo -S echo bar >>/etc/foo.txt"
which doesn't work, because the sudo effects the echo, but not the
redirect.

if you want to do it this way, try:

do shell script "echo password | sudo -S sh -c 'echo bar >> /etc/foo.txt'"

(this is straight out of an example in the sudo man page)

but look at do shell script in the Standard Additions
dictionary and notice the optional clause,"with
administrator privileges"

--
steve harley
_______________________________________________
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.

References: 
 >do shell script and redirection fun! (From: email@hidden)

  • Prev by Date: Re: AppleWorks bug. Can someone please confirm
  • Next by Date: RE: Open For Access Broken in 9?
  • Previous by thread: do shell script and redirection fun!
  • Next by thread: Launch classic?
  • Index(es):
    • Date
    • Thread