I'm rewriting some 20+ year old Unix scripts and I want the output to go to the screen and a file. I know this is possible with tee
. Is there a similar command that stacks new lines on top, at the beginning of a file? I'd like the file to be output in reverse chronological order.
The script output will redirect to a WWW folder. For remotely viewing the output, I want to F5 in a browser and have new lines at the top of the browser window.
I'll recycle the file (cp log log_$(date '+%Y%m%d') && cp /dev/null log
) everyday to keep it from growing too large.
I was hoping tee
had a complimentary utility like cat
has with tac
, but alas no luck.