Re: Osascript and ssh
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.