• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Running ssh from AppleScript...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.
References: 
 >Running ssh from AppleScript... (From: David Crowe <email@hidden>)

  • Prev by Date: SV: Processing files in nested folders
  • Next by Date: Re: ASCII vs. MacRoman (was Re: Standard Additions 'read' command - basic questions)
  • Previous by thread: Re: Running ssh from AppleScript...
  • Next by thread: Re: Running ssh from AppleScript...
  • Index(es):
    • Date
    • Thread