Re: Scripting Teminal.app
Re: Scripting Teminal.app
- Subject: Re: Scripting Teminal.app
- From: Doug McNutt <email@hidden>
- Date: Sun, 22 Dec 2002 18:57:16 -0700
At 16:27 -0700 12/22/02, Marconi wrote:
>
How do I script Terminal to enter more than one line?
In general you can use a semicolon to make the shell think it's seeing more than one line.
>
tell application "Terminal"
>
do script "sudo /System/Library/Path/To/My/Command" in front window
>
end tell
But getting the password in that way is nigh on to impossible. I have had some luck with this kind of thing:
sudo POSIX_path_to_My_Command < $HOME/Pword
where the file Pword in my home directory contains my password, a linefeed, and nothing else. The security implications are ferocious and your command had better not read standard input.. Set the permissions to 600(8) for Pword at a minimum.
Incidentally I don't think you need or want to tell application "Terminal". Do shell script seems to work just fine without involving the Terminal app. Perhaps it uses it anyway but it doesn't leave a terminal window floating around if you just don't tell anyone. You do need to specify the desired shell in your login plist. If your command is a script the #! line seems to be honored and it's not clear if the file has to have the executable bits set.
DCLXVI - The devil with it.
--
--> If you are presented a number as a percentage, and you do not clearly understand the numerator and the denominator involved, you are surely being lied to. <--
_______________________________________________
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.