From owner-freebsd-questions@FreeBSD.ORG Tue May 26 03:00:01 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 3BE43106566B for ; Tue, 26 May 2009 03:00:01 +0000 (UTC) (envelope-from unga888@yahoo.com) Received: from web57002.mail.re3.yahoo.com (web57002.mail.re3.yahoo.com [66.196.97.106]) by mx1.freebsd.org (Postfix) with SMTP id D3FFE8FC12 for ; Tue, 26 May 2009 03:00:00 +0000 (UTC) (envelope-from unga888@yahoo.com) Received: (qmail 63195 invoked by uid 60001); 26 May 2009 03:00:00 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1243306800; bh=XXN1iQPo6nHJuUa64FuCL63Mxb+6IcqMvZY3ybeTTK8=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=V/Rj3A3akCiCC0jAxLG+TKAgd7uSvhAk1dI72xcwFHIvlbR1z44kUP9CNvgKRneALNm1YxVVZwPWmUfVmytlRH047uEnh08nUUP2t4Cy/jDR7tWNURQLv9vjUHYWgg8rdOsF79a16A+VsmWm37thtxEijY9o7Z2PbxnPzS8iXB4= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=vi84zhVEUaYpshP6yVGVoiOrUM6+/InpFlE9OU22CR8TYJiAaLFIDzZcDMXkuLnD7N90u8Ysgj/OwKcFUTvQ6A8K6Y8f8OMyYxen00mZKgAywNcaViZ3IlV1EmieKeLRRgkWcCJN7oFmxtw0dLnnkgnBXqTPYL2+H9XHy7Yrg9g=; Message-ID: <100376.63150.qm@web57002.mail.re3.yahoo.com> X-YMail-OSG: JNQLBPYVM1kw_YYAVkV1LR44.UGTgjfeUe0.qeyyRq8GpF5hIqoRciEkJi5mwUZ.r4ecLP7SvHeO6wsJXLrck2im2890DDjRRylLB_WJrYC_dSzQzbcVao4izhN_2bMYC27J9kZgALJjIIae2Ov2LO6zL4FILDxQv7pPGlAe65lgy0g5hK7cnfhOUv8CDrnjnBj19TyeTTx1TRJUgVP11BNJWboaeMnpj8MEuJ0pCBMXCpj1qKJh5tvmReXhowcx322O.tOMeTUuqrcc_6AjXJtV_gwj6NwfxCxSMv2FHAilpP5jdmtXBgbgWRP7AY.JzuzCN1lc3RA- Received: from [220.255.7.207] by web57002.mail.re3.yahoo.com via HTTP; Mon, 25 May 2009 19:59:59 PDT X-Mailer: YahooMailClassic/5.3.9 YahooMailWebService/0.7.289.10 Date: Mon, 25 May 2009 19:59:59 -0700 (PDT) From: Unga To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable 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: Tue, 26 May 2009 03:00:01 -0000 --- On Tue, 5/26/09, Matthew Seaman wrote= :=0A=0A> From: Matthew Seaman =0A> Subject= : Re: How to say this in Bash?=0A> To: "Unga" =0A> Cc: f= reebsd-questions@freebsd.org=0A> Date: Tuesday, May 26, 2009, 1:20 AM=0A> U= nga wrote:=0A> > --- On Mon, 5/25/09, Jerry =0A> wrote:= =0A> > =0A> >> From: Jerry =0A> >> Subject: Re: How to sa= y this in Bash?=0A> >> To: freebsd-questions@freebsd.org=0A> >> Date: Monda= y, May 25, 2009, 11:22 PM=0A> >> On Mon, 25 May 2009 07:36:45 -0700=0A> >> = (PDT)=0A> >> Unga =0A> >> wrote:=0A> >> =0A> >>> Here is= what happens in bash shell:=0A> >>> $ echo "${X}" > ${Z}=0A> >>> bash: ${Z= }: ambiguous redirect=0A> >> Perhaps I am misinterpreting your question;=0A= > however, if I=0A> >> define both=0A> >> ${X} and ${Z} in a script prior t= o running your=0A> snippet, I=0A> >> do not=0A> >> receive any error messag= e. Could you show more=0A> info on how=0A> >> you are=0A> >> attempting to = run this snippet?=0A> >> =0A> > =0A> > $ X=3D'=0A> >> XX1=3DYES=0A> >> XX2= =3DYES=0A> >> '=0A> > $ echo $X=0A> > XX1=3DYES XX2=3DYES=0A> > $=0A> > $ Y= =3D'=0A> >> YY1=3DYES=0A> >> YY2=3DYES=0A> >> '=0A> > $ echo $Y=0A> > YY1= =3DYES YY2=3DYES=0A> > $=0A> > $ echo "${X}" > ${Z}=0A> > bash: ${Z}: ambig= uous redirect=0A> > =0A> > I want to append all variables in X and Y into Z= so=0A> that "echo $Z" should be:=0A> > XX1=3DYES XX2=3DYES YY1=3DYES YY2= =3DYES=0A> > =0A> > I'm doing everything in command line not using any=0A> = scripts.=0A> > =0A> =0A> That's not how you set a variable.=A0 Do it like t= his:=0A> =0A> Z=3D"${X} ${Y}"=0A> =0A> You're mixing up variable initialisa= tion with output to=0A> files.=A0 =0A=0AOk, this solves the issue. Thanks a= ll for helping me in this regard.=0A=0ABest regards=0AUnga=0A=0A=0A=0A =