do shell script and redirection fun!
do shell script and redirection fun!
- Subject: do shell script and redirection fun!
- From: email@hidden
- Date: Fri, 9 Aug 2002 14:29:39 -0700
More shell related than script related, but...
The problem in a nutshell:
I want root to do a command that reads from standard in
More complexly:
I want root to:
echo bar >> /etc/foo.txt
But in order to do that, I need to do:
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 I was in bash, I could do:
do shell script "echo password | (sudo -S (echo bar >>
/etc/foo.txt))"
which tells the shell that the last parts are complete commands.
Makes sense.
But sh doesn't do this.
So, wizards, how does this one work?
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Seth A. Roby
Scriptwriter Intern
"Life is like an exploded clown. It's really funny until you figure out
what just happened."
_______________________________________________
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.