The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
gzip problem UBD Shell Programming and Scripting 4 12-12-2007 07:32 AM
problem about using zlib to uncompress gzip in memory iwishfine High Level Programming 0 03-24-2007 10:56 PM
tar/gzip/gz...which one to use? abhijeetkul UNIX for Advanced & Expert Users 5 03-24-2006 12:00 AM
using gzip nattie_h UNIX for Advanced & Expert Users 2 11-15-2002 08:28 AM
gzip or FTP problem? DGM UNIX for Advanced & Expert Users 2 09-12-2001 01:13 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 09-18-2006
Registered User
 

Join Date: Jul 2006
Posts: 31
gzip problem

Hi All,

I am zipping a file using
gzip -cq XYZ.txt > XYZ.txt.gz command.

file got created with name XYZ.txt.gz

but when i execute the following command i am getting errors,

$ gzip -t XYZ.txt.gz
gzip: XYZ.txt.gz: invalid compressed data--crc error
gzip: XYZ.txt.gz: invalid compressed data--length error


What could be problem, where i am doing wrong. Please help me out.

Regards,
Ravi Kumar Garlapati
Reply With Quote
Forum Sponsor
  #2  
Old 09-18-2006
Yogesh Sawant's Avatar
Part Time Moderator and Full Time Dad
 

Join Date: Sep 2006
Location: Rossem, Tazenda
Posts: 790
-q option of gzip supresses all warnings. You may have missed some important message there. Try running the command without -q option.
Reply With Quote
  #3  
Old 09-18-2006
Registered User
 

Join Date: Jul 2006
Posts: 31
i did not get any warnings,

i tried this by gzip -c XYZ.txt > XYZ.txt.gz command aswell.

still the same errors are encountered.

i am unable to unzip the file.

Last edited by rkrgarlapati; 09-18-2006 at 11:34 PM.
Reply With Quote
  #4  
Old 09-18-2006
Registered User
 

Join Date: Jul 2006
Posts: 31
Can i know reason of getting these errors.

$ gzip -t XYZ.txt.gz
gzip: XYZ.txt.gz: invalid compressed data--crc error
gzip: XYZ.txt.gz: invalid compressed data--length error
Reply With Quote
  #5  
Old 09-19-2006
blowtorch's Avatar
Supporter
 
Join Date: Dec 2004
Location: Singapore
Posts: 2,326
These errors mean that your gz file is corrupt. There could have been an error while writing the file while running gzip -cq. As Yogesh has said before, try running the gzip -c command again without the -q option.
Reply With Quote
  #6  
Old 09-20-2006
Registered User
 

Join Date: Feb 2005
Location: Ontario
Posts: 20
gzip automatically stores the zipped file in XYZ.txt.gz, you do not need to do a redirect. What you are doing with the redirect is storing any gzip messages in XYZ.txt.gz, instead of the actual zipped data.

Just try "gzip XYZ.txt"
Reply With Quote
  #7  
Old 09-20-2006
blowtorch's Avatar
Supporter
 
Join Date: Dec 2004
Location: Singapore
Posts: 2,326
Quote:
Originally Posted by wvdeijk
What you are doing with the redirect is storing any gzip messages in XYZ.txt.gz, instead of the actual zipped data.
Sorry, but that's plain wrong. The OP is using 'gzip -c'. Check the gzip man page to see what the '-c' switch does. What he is doing is fine, just removing the -q could let him see if any error is being thrown.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 04:10 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0