gunzip -c not working correctly?

Stephan quinte17 at gmx.de
Wed Feb 2 16:06:29 PST 2005


you dont understand the problem ;)
i havent
gunzip -c test.tar.gz
without a pipe ;)

i did:
find . -maxdepth 1 -name "*.tar.gz" -type f -exec bash -cC 'gunzip -c |
pv -N $0 | bzip2 -9 > `echo $0 | sed "s/\.tar\.gz/\.tar\.bz2/g"` && rm $0'
{} \;

but i got the problem that the gunzip -c did touch the original file and
unpacked it into test.tar so the rm $0 which pointed to test.tar.gz couldnt
work...
i had to solve the problem with:

find . -maxdepth 1 -name "*.tar.gz" -type f -exec bash -cC 'cat $0 | gunzip
| pv -N $0 | bzip2 -9 > `echo $0 | sed "s/\.tar\.gz/\.tar\.bz2/g"` && rm $0'
{} \;

yours




More information about the lfs-support mailing list