Please help with Bash syntax error
Hello all,
I have Arch Linux, and am trying to write a bash script to display the CPU Temperature on Conky in °C as well as °F My sensors command output is: Code:
user@host ~ $ sensors Code:
#!/bin/bash Code:
Error in 'tempC()': Parse error Thanks in advance. Regards. |
Out of interest, what does the echo $f produce?
|
fixed it, see if you can spot your mistake?
Code:
#!/bin/bash here's my shell script: Code:
#!/bin/dash Code:
${execp ~/.config/conky/sys/cpu-conky-temp.sh temp1} |
Thanks to ondoho!!!
ondoho,
Thanks so much for correcting the error. I did see the line that you changed, but being a bash newbie, couldn't figure out the exact nature of the error. Guess I will figure it out eventually. Thanks also for the hwmon1 script and the corresponding conky snippet; I will certainly check it out. Regards. |
Re: what does the echo $f produce?
hydrurga,
$f uses the units (linux) utility to convert °C to °F. |
Quote:
Code:
c=${var[5]} | grep -Eo '[-]?[0-9]+([.][0-9]+)?' the quickest and most obvious way to fix it would be like this: Code:
c=`echo ${var[5]} | grep -Eo '[-]?[0-9]+([.][0-9]+)?'` |
Hello All,
Thanks again to ondoho for the help in resolving this issue. In case someone finds it useful, here is the properly functioning bash script: Code:
#!/bin/bash |
All times are GMT -5. The time now is 04:36 AM. |