I have been viewing man pages and using google with little luck so far. I am writing a shell script using wbemcli.
I can execute the command and get the results I need just fine.
ex. wbemcli -nl ein 'http://<username>:<password>@<host>/<targetpc>/root/wmi:MSAcpi_ThermalZoneTemperature'
from the command line, I will get back the instances available on the target pc like so.
<host>:5988/<targetpc>/root/wmi:MSAcpi_ThermalZoneTemperature.InstanceName="ACPI\\ThermalZone\\DTSZ_0"
<host>:5988/<targetpc>/root/wmi:MSAcpi_ThermalZoneTemperature.InstanceName="ACPI\\ThermalZone\\BATZ_0"
<host>:5988/<targetpc>/root/wmi:MSAcpi_ThermalZoneTemperature.InstanceName="ACPI\\ThermalZone\\CPUZ_0"
<host>:5988/<targetpc>/root/wmi:MSAcpi_ThermalZoneTemperature.InstanceName="ACPI\\ThermalZone\\LOCZ_0"
<host>:5988/<targetpc>/root/wmi:MSAcpi_ThermalZoneTemperature.InstanceName="ACPI\\ThermalZone\\VGAZ_0"
If an instance contains CPU, I want to grab the instance name, so I can execute the wbemcli command again to get specific property values.
The problem that I have is that the "http://..." string must be enclosed in single quotes. I have created variables in the script that will would replace the <username>, <password>, <host>, and <targetpc>, but from what I have read so far is that single quotes do no allow variable substitution.
I am not a complete noob to linux/unix, but I have never written something this complex previously. Any help would be greatly appreciated.
TIA,
Scott