3 # zforce: force a gz extension on all gzip files so that gzip will not
6 # This can be useful for files with names truncated after a file transfer.
7 # 12345678901234 is renamed to 12345678901.gz
10 # Copyright (C) 2002 Free Software Foundation
11 # Copyright (C) 1993 Jean-loup Gailly
13 # This program is free software; you can redistribute it and/or modify
14 # it under the terms of the GNU General Public License as published by
15 # the Free Software Foundation; either version 2, or (at your option)
18 # This program is distributed in the hope that it will be useful,
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 # GNU General Public License for more details.
23 # You should have received a copy of the GNU General Public License
24 # along with this program; if not, write to the Free Software
25 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
29 PATH="BINDIR:$PATH"; export PATH
32 echo "force a '.gz' extension on all gzip files"
33 echo usage: $x files...
39 if test ! -f "$i" ; then
40 echo ${x}: $i not a file
46 *[-.]z | *[-.]gz | *.t[ag]z) continue;;
49 if gzip -lv < "$i" 2>/dev/null | grep '^defl' > /dev/null; then
52 if mv "$i" "$new"; then
53 echo $i -- replaced with $new