LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   gunzip unknown suffix -- ignored (https://www.linuxquestions.org/questions/linux-software-2/gunzip-unknown-suffix-ignored-940698/)

schneidz 04-19-2012 01:38 PM

gunzip unknown suffix -- ignored
 
hi, i have about 100 gzipped files that are named like vendor-837-12-04-20-14:44:37.253.

i am trying to gunzip all of them but i keep getting errors like:
gunzip: vendor-837-12-04-20-14:44:37.253: unknown suffix -- ignored

when i 'cp vendor-837-12-04-20-14:44:37.253 vendor-837-12-04-20-14:44:37.253.gz; gunzip vendor-837-12-04-20-14:44:37.253.gz' it behaves correctly but i'll get a hand-cramp from doing that more than 100 times.

since unix uses the magic number to know the file-type, isnt the filename irrelevant ?

thanks,

Spatior 04-19-2012 01:48 PM

Hello

My advise is to escape the - and the : characters, so your instruction end like:

Code:

gunzip [OPTIONS] vendor\-837\-12\-04\-20\-14\:44\:37\.253
Other whise the CLI try to interprate the metacharacters

Regards

schneidz 04-19-2012 01:52 PM

^ thanks for the advice but i am having the same problem like so:
gunzip: vendor.837: unknown suffix -- ignored

but gunzip vendor.837.gz works perfectly.

how to make it so gunzip will take any filename (seems kinda' windows-like to expect an extension on every filename) ?

repo 04-19-2012 02:03 PM

try to use
zcat

Quote:

zcat will uncompress
files that have the correct magic number whether they have a
.gz suffix or not.
Kind regards

unSpawn 04-19-2012 02:10 PM

...or use "--force"

schneidz 04-19-2012 02:10 PM

Quote:

Originally Posted by unSpawn (Post 4657660)
...or use "--force"

good idea but same problem as before.

(hans shot first ;))

schneidz 04-19-2012 02:12 PM

Quote:

Originally Posted by repo (Post 4657625)
try to use
zcat



Kind regards

thanks, i think i am getting closer. now i am getting this error:
Code:

zcat vendor.837
vendor.837.Z: A file or directory in the path name does not exist.


Spatior 04-19-2012 04:43 PM

ok, sorry now i get the problem

look in the man of your gunzip for the -S option, if it exist try the command:

Code:

gunzip -S "" vendor-837-12-04-20-14:44:37.253
HTH

schneidz 04-20-2012 07:25 AM

Quote:

Originally Posted by Spatior (Post 4657780)
ok, sorry now i get the problem

look in the man of your gunzip for the -S option, if it exist try the command:

Code:

gunzip -S "" vendor-837-12-04-20-14:44:37.253
HTH

thanks, getting even closer, i am now getting this error
gunzip: vendor-837-12-04-20-14:44:37.253: cannot decompress onto itself

seems like some limitation of gunzip that i will need to handle in some sort of for loop.

thanks alot.


edit: i got creative and hacked something together that worx:
Code:

zgrep -E "(.|^$)" vendor-837-12-04-20-14:44:37.253 > vendor-837-12-04-20-14:44:37.253.txt
also, i just discovered the obvious:
Code:

cat vendor-837-12-04-20-14:44:37.253 | gunzip > vendor-837-12-04-20-14:44:37.253.txt


All times are GMT -5. The time now is 07:08 AM.