Hello guys, I am new at shell scripting and I want to create a script that runs several commands at a time, ie: uptime, w, df -h and so on and send the output of this commands to a text file so it can be send via email at a certain time using crontab.
I have the following code for an example as a reference:
(uptime &) ; (w &) ; (free &) > /home/my-dir/scripts/example.txt
I want to see in the example.txt the output of the uptime command, saying as a header: Server uptime... then two line breaks, another header should be diplayed and the output to the w command and so on... but at the shell I want nothing to be diplayed...
I hope to made myself clear with this, and thanks once more for your help!