• 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: Osascript and ssh
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Osascript and ssh


  • Subject: Re: Osascript and ssh
  • From: Axel Luttgens <email@hidden>
  • Date: Wed, 28 Apr 2004 13:29:20 +0200

Nigel Smith wrote:

Guys,

I'm trying to do the following from the command line:

ssh username@127.0.0.1 osascript -e 'return 2+2'

...but it fails. Indeed, any script entered using the "-e" flag will fail,
though substituting that with a text file is fine.

I'm wondering if there is a conflict because both ssh and osascript use the
"-e" flag? Can anyone suggest a way round this *without* sending the
osascript commands as a text file?


ssh expects a command, if any, as its last argument.
So, you have to explicitely make your

osascript -e 'return 2+2'

as a single argument for ssh.
In the precise case of your example, enclosing it with double quotes suffices:

ssh username@127.0.0.1 "osascript -e 'return 2+2'"

For more complex scripts to be executed that way, you would probably need to resort to "quoted form of" instead of just enclosing with double quotes, but the idea remains the same.

HTH,
Axel
_______________________________________________
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.


  • Follow-Ups:
    • Re: Osascript and ssh
      • From: Nigel Smith <email@hidden>
References: 
 >Osascript and ssh (From: Nigel Smith <email@hidden>)

  • Prev by Date: Osascript and ssh
  • Next by Date: Re: Osascript and ssh
  • Previous by thread: Osascript and ssh
  • Next by thread: Re: Osascript and ssh
  • Index(es):
    • Date
    • Thread