From owner-freebsd-questions@FreeBSD.ORG Mon May 25 17:21:05 2009 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 4DBF6106564A for ; Mon, 25 May 2009 17:21:05 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from smtp.infracaninophile.co.uk (gate6.infracaninophile.co.uk [IPv6:2001:8b0:151:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id BE2648FC29 for ; Mon, 25 May 2009 17:21:04 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [IPv6:::1]) (authenticated bits=0) by smtp.infracaninophile.co.uk (8.14.3/8.14.3) with ESMTP id n4PHKxHt090323; Mon, 25 May 2009 18:20:59 +0100 (BST) (envelope-from m.seaman@infracaninophile.co.uk) X-DKIM: Sendmail DKIM Filter v2.8.2 smtp.infracaninophile.co.uk n4PHKxHt090323 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=infracaninophile.co.uk; s=200708; t=1243272059; bh=eWALjSwHc/ZHSWMIpa9xxjjbingBJfXz2D0CLpLQ3Uk=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Cc:Content-Type:Date:From:In-Reply-To: Message-ID:Mime-Version:References:To; z=Message-ID:=20<4A1AD37A.5030003@infracaninophile.co.uk>|Date:=20M on,=2025=20May=202009=2018:20:58=20+0100|From:=20Matthew=20Seaman= 20|Organization:=20Infracaninophi le|User-Agent:=20Thunderbird=202.0.0.21=20(X11/20090420)|MIME-Vers ion:=201.0|To:=20Unga=20|CC:=20freebsd-question s@freebsd.org|Subject:=20Re:=20How=20to=20say=20this=20in=20Bash?| References:=20<904563.63141.qm@web57001.mail.re3.yahoo.com>|In-Rep ly-To:=20<904563.63141.qm@web57001.mail.re3.yahoo.com>|X-Enigmail- Version:=200.95.6|Content-Type:=20multipart/signed=3B=20micalg=3Dp gp-sha256=3B=0D=0A=20protocol=3D"application/pgp-signature"=3B=0D= 0A=20boundary=3D"------------enig04E2AC59A0F22B252D665B27"; b=LmUMF0uM/h5b8/uwbsBBHT6wI5Lr/wWsniu1Ld/AduXFztEy6CT92cB5mOOIZPkzS vi/GEkYwUDNaWYFr6T2z+6MLF+D15tPn9fzMov95pmyKUXxOoLOOCw1/0e0Kzi4HKb 3nzXJeGHA1j4uQh3qRHOquh3srZXEsGMMUqDprKA= X-Authentication-Warning: happy-idiot-talk.infracaninophile.co.uk: Host localhost [IPv6:::1] claimed to be happy-idiot-talk.infracaninophile.co.uk Message-ID: <4A1AD37A.5030003@infracaninophile.co.uk> Date: Mon, 25 May 2009 18:20:58 +0100 From: Matthew Seaman Organization: Infracaninophile User-Agent: Thunderbird 2.0.0.21 (X11/20090420) MIME-Version: 1.0 To: Unga References: <904563.63141.qm@web57001.mail.re3.yahoo.com> In-Reply-To: <904563.63141.qm@web57001.mail.re3.yahoo.com> X-Enigmail-Version: 0.95.6 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig04E2AC59A0F22B252D665B27" X-Virus-Scanned: clamav-milter 0.95.1 at happy-idiot-talk.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VERIFIED,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on happy-idiot-talk.infracaninophile.co.uk Cc: freebsd-questions@freebsd.org Subject: Re: How to say this in Bash? 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: Mon, 25 May 2009 17:21:05 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig04E2AC59A0F22B252D665B27 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Unga wrote: > --- On Mon, 5/25/09, Jerry wrote: >=20 >> From: Jerry >> Subject: Re: How to say this in Bash? >> To: freebsd-questions@freebsd.org >> Date: Monday, May 25, 2009, 11:22 PM >> On Mon, 25 May 2009 07:36:45 -0700 >> (PDT) >> Unga >> wrote: >> >>> Here is what happens in bash shell: >>> $ echo "${X}" > ${Z} >>> bash: ${Z}: ambiguous redirect >> Perhaps I am misinterpreting your question; however, if I >> define both >> ${X} and ${Z} in a script prior to running your snippet, I >> do not >> receive any error message. Could you show more info on how >> you are >> attempting to run this snippet? >> >=20 > $ X=3D' >> XX1=3DYES >> XX2=3DYES >> ' > $ echo $X > XX1=3DYES XX2=3DYES > $ > $ Y=3D' >> YY1=3DYES >> YY2=3DYES >> ' > $ echo $Y > YY1=3DYES YY2=3DYES > $ > $ echo "${X}" > ${Z} > bash: ${Z}: ambiguous redirect >=20 > I want to append all variables in X and Y into Z so that "echo $Z" shou= ld be: > XX1=3DYES XX2=3DYES YY1=3DYES YY2=3DYES >=20 > I'm doing everything in command line not using any scripts. >=20 That's not how you set a variable. Do it like this: Z=3D"${X} ${Y}" You're mixing up variable initialisation with output to files. =20 Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate Kent, CT11 9PW --------------enig04E2AC59A0F22B252D665B27 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEAREIAAYFAkoa03sACgkQ8Mjk52CukIzXvQCgiJAxqVkzSwz58xxqb1qFHDOk IpQAoIgO6OeuAReDHgEvZ4FXMeizcHjw =a71g -----END PGP SIGNATURE----- --------------enig04E2AC59A0F22B252D665B27--