Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 May 2009 19:59:59 -0700 (PDT)
From:      Unga <unga888@yahoo.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: How to say this in Bash?
Message-ID:  <100376.63150.qm@web57002.mail.re3.yahoo.com>

next in thread | raw e-mail | index | archive | help

--- On Tue, 5/26/09, Matthew Seaman <m.seaman@infracaninophile.co.uk> wrote=
:=0A=0A> From: Matthew Seaman <m.seaman@infracaninophile.co.uk>=0A> Subject=
: Re: How to say this in Bash?=0A> To: "Unga" <unga888@yahoo.com>=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 <gesbbb@yahoo.com>=0A> wrote:=
=0A> > =0A> >> From: Jerry <gesbbb@yahoo.com>=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 <unga888@yahoo.com>=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     =
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?100376.63150.qm>