Bash – How to Output Two Commands to File

bashscripting

I want to output two commands to a file. I want the exact time (date) AND temperature (sensors) to go to file every 5 minutes. I know how to output one command to a file, but two? How to write such script?

Best Answer

Something like this? (In a loop, cron, or whatever you're currently using.)

(date; my_sensor_command) >> log_file