Re: do shell script and redirection fun!
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.