can't get gunzip to work in bash script
The following bash script will not unzip my files.
They can be unzipped on the command line. If I eliminate the final "| gunzip" the files are listed properly so they are being found and passed along to gunzip. Code:
#!/bin/bash -- Start .. gzip: stdin: not in gzip format -- Finish -- |
When you pipe into g{un}zip, it expects the compressed data from stdin, not the filename, so it complains that what it sees on stdin is not in gzip format.
You should try using find with the exec option instead. Something like this: Code:
find path/to/search -type f -iname '*gz' -exec gunzip {} + |
Thanks astrogeek,
Works fine. R |
All times are GMT -5. The time now is 07:51 AM. |