The system in question is a Raspberry Pi running current Raspbian "buster".
One can get the CPU Temperature using the following:
$ vcgencmd measure_temp
temp=53.0'C
The '
may be replaced with °
using sed
:
$ vcgencmd measure_temp | sed "s/'/°/"
temp=52.0°C
But I'd prefer to do this using tr
which seems a "lighter-weight" alternative to sed
.
I've tried the following in tr
:
$ vcgencmd measure_temp | tr ' ° # nope
$ vcgencmd measure_temp | tr \' \° # nope
temp=53.0�C
# Yet, this works:
$ vcgencmd measure_temp | tr \' d
temp=52.0dC
$
What am I missing? does the degree symbol require special care?
tr
, but I'm out of my depth on that - this baffles me. – Seamus Apr 30 '20 at 22:25tr
fully supports only single-byte characters". – fra-san Apr 30 '20 at 22:39