mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-08 13:28:05 +00:00
Unbroke zforce.
PR: 8348 Submitted by: Christoph Weber-Fahr <wefa@callcenter.systemhaus.net>
This commit is contained in:
parent
2336ecd56f
commit
994b5741d9
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=49621
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user