I want to write a bash script to decompress a file without overwriting the original one and redirect the operation result into a log file.
I found an answer to the first part of my question at: How to tell gzip to keep original file?
But I cannot report it into a log.
I've tried:
gzip -dfv < file.txt.gz > file.txt 2>&1 | tee -a log.txt
But it does not redirect operation output to log.txt file.
How can I do that?
Thank you all.
Note: I am working on a Virtual Machine which runs Ubuntu 10.04 and the installed gzip 1.3.12 does not offer the --keep option. I should avoid updating any package in my system, because it is under strict configuration control and all updates are disabled due to security policies.