Re: Running ssh from AppleScript...
Re: Running ssh from AppleScript...
- Subject: Re: Running ssh from AppleScript...
- From: Christopher Nebel <email@hidden>
- Date: Tue, 20 Jan 2004 10:43:52 -0800
On Jan 19, 2004, at 9:26 AM, David Crowe wrote:
I'm not having much success running 'ssh' from AppleScript. The
command line:
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. ...
running ssh directly results in it complaining that it's standard
input is not a terminal.
Yes, well, that should have been a big clue right there. "do shell
script" is not an interactive terminal session -- it's a
non-interactive sub-shell, and there's a big difference where some
commands (like ssh) are concerned. [1] Go read TN2065
<
http://developer.apple.com/technotes/tn2002/tn2065.html>, especially
the "Other Concerns" section, and then check out expect(1).
--Chris Nebel
AppleScript Engineering
[1] Those who think this is an AppleScript perversion are advised to
try something similar using the equivalent qx// construct in Perl.
This behavior is *not* unique to AppleScript.
_______________________________________________
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.