From owner-freebsd-questions@FreeBSD.ORG Fri Oct 15 11:58:20 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98B711065672 for ; Fri, 15 Oct 2010 11:58:20 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id 190FB8FC1A for ; Fri, 15 Oct 2010 11:58:19 +0000 (UTC) X-Spam-Status: No X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-2.9, required 5, autolearn=not spam, ALL_TRUSTED -1.00, BAYES_00 -1.90) X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-ID: o9FBw39K025760 Received: from gkeramidas-glaptop.linux.gr ([74.125.57.33]) (authenticated bits=0) by igloo.linux.gr (8.14.3/8.14.3/Debian-9.2) with ESMTP id o9FBw39K025760 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 15 Oct 2010 14:58:10 +0300 From: Giorgos Keramidas To: Matthias Apitz References: <20101014083659.GA3150@current.Sisis.de> Date: Fri, 15 Oct 2010 13:58:03 +0200 In-Reply-To: <20101014083659.GA3150@current.Sisis.de> (Matthias Apitz's message of "Thu, 14 Oct 2010 10:36:59 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd-questions@freebsd.org Subject: Re: gzip tries to unpack/pack 1st the filename of $GZIP X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Oct 2010 11:58:20 -0000 On Thu, 14 Oct 2010 10:36:59 +0200, Matthias Apitz wrote: > Hello, > > I was facing a problem in some Makefile/shell-scripting and finally I > could nail it down: > > when you set the environment variable GZIP to something, for example to > let it point to gzip itself, it tries 1st to unpack this file: > > $ GZIP=/usr/bin/gzip export GZIP > $ $GZIP -dc source.tar.gz | wc -l > gzip: /usr/bin/gzip: not in gzip format > 645770 > > o > > $ GZIP=bla export GZIP > $ gzip -dc source.tar.gz | wc -l > gzip: can't stat: bla: No such file or directory > 645770 > > Why is this? It's not mentioned in the man page. Look at the info documentation of gzip: .---[ info gzip 'Environment' ]----------------------------------------- | 5 Environment | ************* | | The environment variable `GZIP' can hold a set of default options for | `gzip'. These options are interpreted first and can be overwritten by | explicit command line parameters. For example: | | for sh: GZIP="-8v --name"; export GZIP | for csh: setenv GZIP "-8v --name" | for MSDOS: set GZIP=-8v --name | | On VMS, the name of the environment variable is `GZIP_OPT', to avoid | a conflict with the symbol set for invocation of the program. | `-----------------------------------------------------------------------