[EMAIL PROTECTED] writes: >> gzip -f test_Z > gzip: test_Z already has _Z suffix -- unchanged > > But the gzip man page lists ony the following suffixes (admittedly: for > gunzip; > but one would expect the same in this case): > > .gz, -gz, .z, -z, _z or .Z > > (Same problem exists for files like test-Z.) > How can I force compression on such files? (with suffix _Z, -Z)
Thanks for the bug report. -f should work here. Also, the documentation should say case is ignored. I installed this and it should appear in the next gzip version. In the meantime you can work around it by temporarily renaming the file (ugh!). 2007-05-07 Paul Eggert <[EMAIL PROTECTED]> * NEWS: 'gzip -f foo.gz' now works instead of complaining. * gzip.c (make_ofname): Implement this. Problem reported by Sven Hartrump in <http://lists.gnu.org/archive/html/bug-gzip/2007-05/msg00003.html>. * NEWS, gzip.1: Document that case is ignored when looking at file name extensions. * doc/gzip.texi (Overview): Likewise. Index: NEWS =================================================================== RCS file: /cvsroot/gzip/gzip/NEWS,v retrieving revision 1.16 diff -u -p -r1.16 NEWS --- NEWS 13 Apr 2007 21:42:54 -0000 1.16 +++ NEWS 7 May 2007 23:24:51 -0000 @@ -2,6 +2,12 @@ Major changes in Gzip 1.3.12 (2007-04-13 * znew now uses $TMPDIR (default /tmp) instead of always using /tmp. +* 'gzip -f foo.gz' now creates a file foo.gz.gz instead of complaining. + +* It is now documented that gzip ignores case when examining file name + extensions; for example, 'gzip test.Gz' (without -f) fails because + the file name ends in '.Gz'. + Major changes in Gzip 1.3.11 (2007-02-05) * As per the GNU coding standards, the behavior of gzip and its Index: gzip.c =================================================================== RCS file: /cvsroot/gzip/gzip/gzip.c,v retrieving revision 1.16 diff -u -p -r1.16 gzip.c --- gzip.c 20 Mar 2007 05:09:51 -0000 1.16 +++ gzip.c 7 May 2007 23:24:51 -0000 @@ -1165,7 +1165,7 @@ local int make_ofname() } /* ofname might be changed later if infile contains an original name */ - } else if (suff != NULL) { + } else if (suff && ! force) { /* Avoid annoying messages with -r (see treat_dir()) */ if (verbose || (!recursive && !quiet)) { /* Don't use WARN, as it affects exit status. */ Index: gzip.1 =================================================================== RCS file: /cvsroot/gzip/gzip/gzip.1,v retrieving revision 1.6 diff -u -p -r1.6 gzip.1 --- gzip.1 8 Dec 2006 18:45:37 -0000 1.6 +++ gzip.1 7 May 2007 23:24:51 -0000 @@ -72,7 +72,7 @@ legal. .PP .I gunzip takes a list of files on its command line and replaces each -file whose name ends with .gz, -gz, .z, -z, _z or .Z +file whose name ends with .gz, -gz, .z, -z, or _z (ignoring case) and which begins with the correct magic number with an uncompressed file without the original extension. .I gunzip Index: doc/gzip.texi =================================================================== RCS file: /cvsroot/gzip/gzip/doc/gzip.texi,v retrieving revision 1.5 diff -u -p -r1.5 gzip.texi --- doc/gzip.texi 5 Feb 2007 23:29:04 -0000 1.5 +++ doc/gzip.texi 7 May 2007 23:24:51 -0000 @@ -80,7 +80,7 @@ Free Documentation License''. @command{gzip} reduces the size of the named files using Lempel-Ziv coding (LZ77). Whenever possible, each file is replaced by one with the extension @samp{.gz}, while keeping the same ownership modes, access and -modification times. (The default extension is @option{-gz} for @abbr{VMS}, +modification times. (The default extension is @samp{-gz} for @abbr{VMS}, @samp{z} for @abbr{MSDOS}, @abbr{OS/2} @abbr{FAT} and Atari.) If no files are specified or if a file name is "-", the standard input is compressed to the standard @@ -113,8 +113,9 @@ compressed file is not suitable for its constructed from the original one to make it legal. @command{gunzip} takes a list of files on its command line and replaces -each file whose name ends with @samp{.gz}, @samp{.z}, @samp{.Z}, [EMAIL PROTECTED], @option{-z} or @samp{_z} and which begins with the correct +each file whose name ends with @samp{.gz}, @samp{.z} [EMAIL PROTECTED], @samp{-z}, or @samp{_z} (ignoring case) +and which begins with the correct magic number with an uncompressed file without the original extension. @command{gunzip} also recognizes the special extensions @samp{.tgz} and @samp{.taz} as shorthands for @samp{.tar.gz} and @samp{.tar.Z}