I am capturing the output of a sensor using:
mosquitto_sub -t tele/tasmota_BCA2B4/SENSOR >> volt.log
giving a file with
{"Time":1746498887,"ANALOG":{"Voltage1":1.341},"ESP32":{"Temperature":46.100},"TempUnit":"C"}
{"Time":1746498917,"ANALOG":{"Voltage1":1.339},"ESP32":{"Temperature":45.100},"TempUnit":"C"}
To clean it up I'm piping into sed:
mosquitto_sub tele/tasmota_BCA2B4/SENSOR | sed -e 's/{"Time"://' -e 's/,"ANALOG":{"Voltage1":/ /' -e 's/},"ESP32":{"Temperature":/ /' -e 's/},"TempUnit":"C"}//'
And the result is displayed on my screen:
1746498887 1.341 46.100
1746498917 1.339 45.100
However if I add >> volt.log to the above command nothing is appended to the file. Using > volt.log the file was deleted (as expected) and the resultant had zero length. Why can I not redirect what's appearing on my screen (presumably stdout) to a file? What should I be doing?
Note that I have removed -u and -p from the mosquitto_sub command.