diff options
author | ru <ru@FreeBSD.org> | 1999-08-11 10:34:57 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 1999-08-11 10:34:57 +0000 |
commit | 51e8eceb2db29ce513374f70faf2012ca0509ef7 (patch) | |
tree | 736944cc5ec40b8085d828673d00a6fb6e564eaf /gnu | |
parent | d3695c1d0371e1f02895f7217864a7634ec907ba (diff) | |
download | FreeBSD-src-51e8eceb2db29ce513374f70faf2012ca0509ef7.zip FreeBSD-src-51e8eceb2db29ce513374f70faf2012ca0509ef7.tar.gz |
Unbroke zforce.
PR: 8348
Submitted by: Christoph Weber-Fahr <wefa@callcenter.systemhaus.net>
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/usr.bin/gzip/zforce | 12 | ||||
-rw-r--r-- | gnu/usr.bin/gzip/zforce.1 | 8 |
2 files changed, 7 insertions, 13 deletions
diff --git a/gnu/usr.bin/gzip/zforce b/gnu/usr.bin/gzip/zforce index 808b0d0..02d07e7 100644 --- a/gnu/usr.bin/gzip/zforce +++ b/gnu/usr.bin/gzip/zforce @@ -3,9 +3,9 @@ # compress them twice. # # This can be useful for files with names truncated after a file transfer. -# 12345678901234 is renamed to 12345678901.gz +# foo is renamed to foo.gz # -# $Id$ +# $Id: zforce,v 1.3 1999/05/28 13:23:20 kris Exp $ x=`basename $0` if test $# = 0; then @@ -25,13 +25,9 @@ for i do test `expr "$i" : '.*[.-]gz$'` -eq 0 || continue test `expr "$i" : '.*[.]t[ag]z$'` -eq 0 || continue - if gzip -l < "$i" 2>/dev/null | grep '^defl' > /dev/null; then + if gzip -lv < "$i" 2>/dev/null | grep '^defl' > /dev/null; then - if test `expr "$i" : '^............'` -eq 12; then - new=`expr "$i" : '\(.*\)...$`.gz - else - new="$i.gz" - fi + new="$i.gz" if mv "$i" "$new" 2>/dev/null; then echo $i -- replaced with $new continue diff --git a/gnu/usr.bin/gzip/zforce.1 b/gnu/usr.bin/gzip/zforce.1 index 37c6aba..2bfb20d 100644 --- a/gnu/usr.bin/gzip/zforce.1 +++ b/gnu/usr.bin/gzip/zforce.1 @@ -3,7 +3,7 @@ zforce \- force a '.gz' extension on all gzip files .SH SYNOPSIS .B zforce -[ name ... ] +name ... .SH DESCRIPTION .I zforce forces a .gz extension on all @@ -12,9 +12,7 @@ files so that .I gzip will not compress them twice. This can be useful for files with names truncated after a file transfer. -On systems with a 14 char limitation on file names, the original name -is truncated to make room for the .gz suffix. For example, -12345678901234 is renamed to 12345678901.gz. A file name such as foo.tgz -is left intact. +For example, 12345678901 is renamed to 12345678901.gz. +A file name such as foo.tgz is left intact. .SH "SEE ALSO" gzip(1), znew(1), zmore(1), zgrep(1), zdiff(1), gzexe(1) |