I have an LED sign set up with a Windows computer, and am trying to make it display my Linux computer’s temperature:
acpitz-virtual-0
Adapter: Virtual device
temp1: +97.7°F (crit = +183.2°F)
Now, here’s the batch file on my computer
wget 192.168.1.58/sensor1.txt
I have a windows version of wget in the folder.
type sensor1.txt | findstr /v acpitz-virtual-0 | findstr /v Adapter: > msg.txt
set /p msg= < msg.txt
prismcom.exe usb {HOLD} %msg%
Now my sign flashes the equivalent of
temp1: +97.7°F (crit = +183.2°F)
I need it to flash
+97.7°F,
or even better,
+97.7 F
I’ve been trying with FIND and FOR and commands like that, but with no luck. How can I modify my string to work?
Thanks!
Say the variable that the temperature is stored in is called “temp”, and has the value of “temp1: +97.7°F (crit = +183.2°F)”. This little snippet should work wonders…
Here is the syntax:
One thing I should mention is that the variable “TEMP” (or “temp”, capitalization generally doesn’t matter too much with .bat files) is a predefined command line variable, and generally those should never be overwritten. However, in this case it’s purely for aesthetic purposes and you can change it to whatever you want.
–EDIT–
Added two lines to allow for temperatures over 100 Fahrenheit. Also changed
temptodis.