06-16-2011
Requesting help with shell script
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
8 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Test - Test (1 Reply)
Discussion started by: Amit Sura
1 Replies
2. Shell Programming and Scripting
hi guys linux noob here wanting to learn linux scripting, i need help with a backup script that not only allows me to back up my files but restore them to my own personal directory, had a look at some of the coding from the scripts section on this site but still lost.
any help is much appreciated (8 Replies)
Discussion started by: burnie35
8 Replies
3. Shell Programming and Scripting
how do I request a new and available local port (TCP) to use with shell script? (2 Replies)
Discussion started by: timmylita
2 Replies
4. Shell Programming and Scripting
Hello every1,
I need help to replace a string in a file by my bash script.
Find: log4j.appender.toLogFile.layout.ConversionPattern= %d %5p (%F:%L) - %m%n= %d %5p (%F:%L) - %m%n
Replace: log4j.appender.toLogFile.layout.ConversionPattern= %d %5p (%F:%L) - %m%n
I tried by sed, but kept... (7 Replies)
Discussion started by: titanic4u
7 Replies
5. Post Here to Contact Site Administrators and Moderators
Hi admins and moderators!!
Happy new year and merry Christmas :D
Well, I have been here a few months now as a registered member and may be 6-7 years that I got numerous help directly and indirectly from this site as a guest.
Unix.com really has a vast collection of posts on wide variety of... (15 Replies)
Discussion started by: admin_xor
15 Replies
6. Shell Programming and Scripting
Hi,
balajesuri and durden_tyler, I have found your perl script for the thread https://www.unix.com/shell-programming-scripting/176370-perl-script-help-me-extracting-string.html, but find it difficult to understand the syntax.
Could you or any forum members kindly shed some light on the logic... (3 Replies)
Discussion started by: royalibrahim
3 Replies
7. SCO
Sir I want to practice SCO_Unix so I want to install SCO_UnixWare7.1.4 on virtualbox so can you please suggest the procedure how to install it on virtualbox. My host Operating System is OpenSuse12.3. I am unable to run VmWare on my OS so please suggest how to install on virtualbox only.
... (0 Replies)
Discussion started by: rupeshforu3
0 Replies
8. Shell Programming and Scripting
HI Everyone,
I have TL1 script which takes the temperature of a CISCO equipment through TELNET now i need to save the output of the command to a csv file .
Like this is the output
> RTRV-SHELFSTAT:AB1S2a::1;
AB1S2a 2016-02-03 22:29:39
M 1 COMPLD
... (2 Replies)
Discussion started by: adgjmpt
2 Replies
ACPIWMI(4) BSD Kernel Interfaces Manual ACPIWMI(4)
NAME
acpiwmi -- Windows Management Instrumentation support for ACPI
SYNOPSIS
acpiwmi* at acpi?
acpiwmibus* at acpiwmi?
wmidell* at acpiwmibus?
wmieeepc* at acpiwmibus?
wmihp* at acpiwmibus?
wmimsi* at acpiwmibus?
DESCRIPTION
The acpiwmi device driver provides an ACPI interface for Windows Management Instrumentation (WMI). The ACPI WMI interface is typically used
to support vendor specific features found in various laptops.
The following WMI mappings are supported:
wmidell Dell laptops
wmieeepc Some models of Asus Eee PC
wmihp Hewlett-Packard laptops
wmimsi MSI laptops
The functionality varies from vendor to vendor. Typically the interface is used for function and hotkey handling, but additional features
may be present.
SEE ALSO
acpi(4), acpidalb(4)
Microsoft Corporation, Windows Instrumentation: WMI and ACPI, http://www.microsoft.com/whdc/system/pnppwr/wmi/wmi-acpi.mspx, December 4,
2001.
HISTORY
The acpiwmi device driver appeared in NetBSD 6.0.
AUTHORS
Jukka Ruohonen <jruohonen@iki.fi> wrote acpiwmi and most of the mappings.
CAVEATS
While WMI should provide a certain degree of portability across laptop models from a particular vendor, there is no guarantee that the map-
pings are functional in all models.
The wmihp driver may conflict with hpqlb(4).
BSD
February 16, 2011 BSD