Re: Running ssh from AppleScript...
Re: Running ssh from AppleScript...
- Subject: Re: Running ssh from AppleScript...
- From: Doug McNutt <email@hidden>
- Date: Mon, 19 Jan 2004 16:17:09 -0700
At 10:26 -0700 1/19/04, David Crowe wrote:
>
I'm not having much success running 'ssh' from AppleScript.
>
do shell script "(echo \"~/ssh-mail\" | login -f $USER ) &"
>
runs ssh (via the script 'ssh-mail' which only executes the Unix
>
'ssh' command with the right port mapping) but it logs out right away.
Applescript creates a new instance of bash for each invocation of "do shell script". There are no options even to change your default shell. When the shell returns to AppleScript it is terminated and that creates the result you see.
As a logged in Mac user you do not have a login shell. The Finder does not behave as a shell. You are NOT a UNIX user. It's a shame but that's the way Steve seems to want it. The only way you can become a UNIX user, after an OS neXt logi,n is to establish a Terminal session. ssh from there to anywhere works fine. X11 is similar. You can ssh from there and do what you expect.
AppleScript will forever remain a MacOS neXt application which simply will not be UNIX. Well, that's an opinion, but nothing I have said publicly is well received. Everyone thinks Apple has it right. Sigh.
And, by the way, when you execute Terminal do not expect your $PATH variable as set in environment.plist to be honored.
You might want to investigate BBEdit worksheets but they don't handle interactive tools well.
You might also want to
tell application "X11"
activate
. . .
end tell
but I haven't tried it. I doubt that X11 is scriptable.
Finder needs to BE a shell dammit.
--
Applescript syntax is like English spelling:
Roughly, but not thoroughly, thought through.
_______________________________________________
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.