From owner-freebsd-questions@FreeBSD.ORG Thu Oct 14 16:04:46 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 4AC8B1065670 for ; Thu, 14 Oct 2010 16:04:46 +0000 (UTC) (envelope-from dteske@vicor.com) Received: from postoffice.vicor.com (postoffice.vicor.com [69.26.56.53]) by mx1.freebsd.org (Postfix) with ESMTP id 32A368FC18 for ; Thu, 14 Oct 2010 16:04:45 +0000 (UTC) Received: from [208.206.78.30] (port=60773 helo=dt.vicor.com) by postoffice.vicor.com with esmtpsa (SSLv3:RC4-MD5:128) (Exim 4.71) (envelope-from ) id 1P6QIM-0001Wq-Ob; Thu, 14 Oct 2010 09:04:45 -0700 From: Devin Teske To: Matthias Apitz In-Reply-To: <20101014144857.GA5236@current.Sisis.de> References: <20101014083659.GA3150@current.Sisis.de> <44bp6walf2.fsf@be-well.ilk.org> <20101014144857.GA5236@current.Sisis.de> Content-Type: text/plain; charset=utf-8 Organization: Vicor, Inc Date: Thu, 14 Oct 2010 09:04:42 -0700 Message-Id: <1287072282.15487.11.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-41.el4) Content-Transfer-Encoding: quoted-printable X-Scan-Signature: 0d9dfa6ff96cd824ec6bfe86eb239ecf X-Scan-Host: postoffice.vicor.com Cc: Lowell Gilbert , 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: Thu, 14 Oct 2010 16:04:46 -0000 On Thu, 2010-10-14 at 16:48 +0200, Matthias Apitz wrote: > El d=C3=ADa Thursday, October 14, 2010 a las 10:39:13AM -0400, Lowell Gil= bert escribi=C3=B3: >=20 > > Matthias Apitz writes: > >=20 > > > 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: > > > > ... >=20 > This was my fault. I overlooked it in the man page. SOrry; >=20 > > You need to fix the syntax on your 'export' lines. > > Adding a semicolon before the "export" keyword (or > > moving it to the next line) is the smallest change=20 > > to do this. >=20 > Why? >=20 > $ FIX=3Dfoo export FIX > $ env | fgrep FIX > FIX=3Dfoo >=20 > matthias >=20 I'm with matthias on this one... Here's the technical explanation: When performing assignment in bourne/again shell, if the right-hand side of the assignment (=3D) does not begin with either a single-quote or double-quote, spaces will terminate the assignment and begin a new command. For example: abc=3D123 echo hello, world ^ | end of assignment (start of new command; imagine implied semi-colon) This produces two distinct commands: 1. abc=3D123 2. echo hello world Contrast that with either: abc=3D"123 echo hello world" or abc=3D123\ echo\ hello,\ world Both of which succeed in assigning `123 echo hello, world' to variable `abc'. Pop Quiz: What does the following do: abc=3D123\ xyz echo hello Answer: 1. assigns `123 xyz' to variable `abc' 2. executes: echo hello Second Pop Quiz: abc=3D"123 xyz" echo hello Answer: 1. assigns `123 xyz' to variable `abc' 2. executes: echo hello This obviously doesn't work in tennex/c shell: # echo $0 $SHELL -csh /bin/csh # abc=3D123 abc=3D123: Command not found. # ls -li `which csh tcsh` 1411 -r-xr-xr-x 2 root wheel 651964 Jan 23 2007 /bin/csh 1411 -r-xr-xr-x 2 root wheel 651964 Jan 23 2007 /bin/tcsh --=20 Cheers, Devin Teske -> CONTACT INFORMATION <- Business Solutions Consultant II FIS - fisglobal.com 510-735-5650 Mobile 510-621-2038 Office 510-621-2020 Office Fax 909-477-4578 Home/Fax devin.teske@fisglobal.com -> LEGAL DISCLAIMER <- This message contains confidential and proprietary information of the sender, and is intended only for the person(s) to whom it is addressed. Any use, distribution, copying or disclosure by any other person is strictly prohibited. If you have received this message in error, please notify the e-mail sender immediately, and delete the original message without making a copy. -> END TRANSMISSION <-