I have been trying to extract a file from a tgz archive for hours.
tar -xzf my.tgz ./file.sh extract the file properly. However, an installation script I am using is extracting the file differently, using
tar xfzO my.tgz ./file.sh > /tmp/file.sh.
In the first case, tar complete correctly, extracting the file as intended. In the second case however, it output a message informing me that ./file.sh was not found in the archive. Strangely,
tar --list ./file.sh -f my.tgz output that the file doesn't exist, but then why is it successfully extracted the first time ?
How can I extract my file, using the second method properly ? Why is tar not finding it, despite it being there ?