I have a shell script which does echo for some important places in the logic. Every time I do an echo I apeend the log to a log file by doing a >> /some/location/my_logtxt.
The logic looks like below
ret=123 echo Something happened $ret >> /some/location/my_logtxt // some logic echo Something else happened $ret >> /some/location/my_logtxt // some more logic echo Something else happened again $ret >> /some/location/my_logtxt Question:
Isnt there a single statement which can state all the echo statement logs go into the following file instead of doing this >> /some/location/my_logtxt for every echo?