|
|
#1 |
|
Triple-A Player
Join Date: Jan 2002
Location: Germany
Posts: 55
|
I have two machines, "powerbook" and "imac". There's a process running on powerbook called 'Microsoft Database Daemon' (MDD). It has the PID 1234. I can ssh from imac to powerbook and get a shell without entering a password.
Code:
ssh powerbook Code:
killall 'Microsoft Database Daemon' I can also type Code:
ssh powerbook kill 1234 I can also type Code:
ssh powerbook killall TextEdit Now, what doesn't work is Code:
ssh powerbook killall 'Microsoft Database Daemon' Can anyone please enlighten me?
__________________
iMac 20" 2.66, 4GB, 10.6.x MacBook 2.0, 2GB, 10.6.x G4 466, 896MB, 10.4.x PowerBook G3 333, 256MB, 10.3.x assorted other older Macs |
|
|
|
|
|
#2 |
|
Site Admin
Join Date: Jan 2002
Location: Montreal
Posts: 32,473
|
It seems likely that this is due to the spaces in the name of the process.
|
|
|
|
|
|
#3 |
|
Major Leaguer
Join Date: Nov 2002
Posts: 285
|
It's perhaps because the 's get interpreted by the shell at this end in order to make that all one argument to the command, but you need to get it interpreted by the shell at the other end. Try escaping the 's, eg
ssh powerbook killall \'Microsoft Database Daemon\' |
|
|
|
|
|
#4 |
|
Triple-A Player
Join Date: Jan 2002
Location: Germany
Posts: 55
|
Yee-haw! That did it! I tried escaping the blanks before but never the single quotes. Cool!
__________________
iMac 20" 2.66, 4GB, 10.6.x MacBook 2.0, 2GB, 10.6.x G4 466, 896MB, 10.4.x PowerBook G3 333, 256MB, 10.3.x assorted other older Macs |
|
|
|
|
|
#5 |
|
Triple-A Player
Join Date: Jan 2002
Location: Germany
Posts: 55
|
Now I need to find a way to issue this command in AppleScript. Code:
do shell script "ssh powerbook killall \'Microsoft Database Daemon\'" |
|
|
|
|
|
#6 |
|
Major Leaguer
Join Date: Nov 2002
Posts: 285
|
Put the command in a script, eg
#!/bin/sh ssh powerbook killall \'whatever it is\' then chmod +x it, and call that from the AS? |
|
|
|
|
|
#7 |
|
Triple-A Player
Join Date: Jan 2002
Location: Germany
Posts: 55
|
I found the solution on one of Apple's developer pages: just escape the escape characters:
Code:
do shell script "ssh powerbook killall \\'Microsoft Database Daemon\\'" |
|
|
|
![]() |
|
|