[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [OT] Scriptproblem SSH oder VMware oder....



Hallo,

Am Mon, 08 Jan 2007, Christian Schmidt schrieb:
>> # ssh root@vmserver1 -t /usr/bin/vmware-cmd /home/vmware/VMs/host1/Windows 2000 Server.vmx getstate
>> /usr/bin/vmware-cmd: Could not connect to VM /home/vmware/VMs/host1/Windows
>>   (VMControl error -11: No such virtual machine: The config file /home/vmware/VMs/host1/Windows is not registered.
[..]
>Versuch's mal so:
>ssh root@vmserver1 -t /usr/bin/vmware-cmd \
>/home/vmware/VMs/host1/Windows\ 2000\ Server.vmx getstate

Geht beides nicht. Grund: Einmal bekommt das die lokale shell zu sehen
und zum anderen die auf dem remote host. D.h. es wird zweimal
"word-splitting" durchgeführt.

Man muss also die Leerzeichen "doppelt" schützen. Ungetestet:

ssh root@vmserver1 -t /usr/bin/vmware-cmd \
    /home/vmware/VMs/host1/Windows\\\ 2000\\\ Server.vmx getstate
ssh root@vmserver1 -t /usr/bin/vmware-cmd \
    "/home/vmware/VMs/host1/Windows\ 2000\ Server.vmx" getstate
ssh root@vmserver1 -t '/usr/bin/vmware-cmd \
    "/home/vmware/VMs/host1/Windows 2000 Server.vmx" getstate'
ssh root@vmserver1 -t "/usr/bin/vmware-cmd \
    \"/home/vmware/VMs/host1/Windows 2000 Server.vmx\" getstate"

und andere Variationen zum Thema.

Bei sowas hilft generell wenn man die shells mit 'set -x' dazu bringt
anzuzeigen was sie wie aufrufen.

-dnh

-- 
The only languages that can comfortably be written with the repertoire of
US-ASCII happen to be Latin, Swahili, Hawaiian and American English without
most typographic frills. It is rumoured that there are more languages in the
world.                                                     -- Roman Czyborra



Reply to: