• 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: Send commands to remote machine with 'do shell script'
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Send commands to remote machine with 'do shell script'


  • Subject: Re: Send commands to remote machine with 'do shell script'
  • From: Axel Luttgens <email@hidden>
  • Date: Tue, 29 Jul 2008 12:05:58 +0200

Le 29 juil. 08 à 11:51, Alan Fairlie a écrit :

I have setup ssh to login in without asking for a password with dsa keys.
Now I want to send commands to the remote machine.
I have tried the following.


do shell script "ssh user@address ; ps"

But the 'ps' returns processes for the local machine.

Hello Alan,

In the shell process spawned by "do shell script", you are executing two commands in turn: "ssh", then "ps".
You should pass the command to be run on the remote box as an argument to the ssh command:


	do shell script "ssh user@address ps"

Yeah, one char matters... ;-)
But I guess you would have to pass some arguments to ps as well, for example:


	do shell script "ssh user@address ps -ax"

depending on the processes you are interested in.

HTH,
Axel

_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
  • Follow-Ups:
    • Re: Send commands to remote machine with 'do shell script'
      • From: Alan Fairlie <email@hidden>
References: 
 >Send commands to remote machine with 'do shell script' (From: Alan Fairlie <email@hidden>)

  • Prev by Date: Re: slash path to alias
  • Next by Date: Re: Send commands to remote machine with 'do shell script'
  • Previous by thread: Send commands to remote machine with 'do shell script'
  • Next by thread: Re: Send commands to remote machine with 'do shell script'
  • Index(es):
    • Date
    • Thread