store cpu temperature in variable

view story

http://stackoverflow.com – I am trying to parse out the temperature information from what lm-sensors provides in the Linux shell command: $sensors I suspect I am muddling this more than necessary. First: is there a pre-existing environmental variable or something for CPU temperature? I tried using the command: $ sensors -A -f | awk '{print $2}' +136.4°F but I get some undesired white space, and some unwanted other characters. such as +. degree sign, F. so then I tried my hand at greping the digits out with: sensors -A -f | awk '{print $2}' | egrep -o [0-9]\.?[0-9] but every time, I get the digits before the decima (HowTos)