I am trying to figure a way to have a log file and still keep the output in the terminal in a script.
The example below logs to a file nicely but i still want the output in the terminal as well
#!/bin/bash
#Create a log
exec >> /path/to/my/logfile
echo "hello world"
Any help would be much appreciated, ive played with tee am im sure thats the way, but just cant figure it out.