I am using vim to make a simple script trying get the output of lm_sensors into another file. My problem is the formatting that needs to be done with requires combining two lines and outputting them into a file. Here is what I have currently:
LINE1=(echo -en System: INFO $(date +%x) $(date +%T) : CPU Temperature \{ ; sensors| grep Core\ sed 's/ /, /g'|tr -d '\n')
LINE2=(echo -e \})
echo $LINE1$LINE2 >> (FILE PATH)
LINE2’s sole purpose is to put a } bracket at the end of the data, so if there is a better way to do that all in one line I am all ears.
Disregarding the sed and tr commands which format the data, I would like the output data to look as follows, though I always get an ‘unexpected token ‘;” error message with the above script.
System: INFO (date time) : CPU Temperature { CPU Temp DATA }
I greatly appreciate all input.
Try this, perhaps:
Alternatively: