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>
index | next in thread | raw e-mail
--- On Tue, 5/26/09, Matthew Seaman <m.seaman@infracaninophile.co.uk> wrote:
> From: Matthew Seaman <m.seaman@infracaninophile.co.uk>
> Subject: Re: How to say this in Bash?
> To: "Unga" <unga888@yahoo.com>
> Cc: freebsd-questions@freebsd.org
> Date: Tuesday, May 26, 2009, 1:20 AM
> Unga wrote:
> > --- On Mon, 5/25/09, Jerry <gesbbb@yahoo.com>
> wrote:
> >
> >> From: Jerry <gesbbb@yahoo.com>
> >> 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 <unga888@yahoo.com>
> >> 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?
> >>
> >
> > $ X='
> >> XX1=YES
> >> XX2=YES
> >> '
> > $ echo $X
> > XX1=YES XX2=YES
> > $
> > $ Y='
> >> YY1=YES
> >> YY2=YES
> >> '
> > $ echo $Y
> > YY1=YES YY2=YES
> > $
> > $ echo "${X}" > ${Z}
> > bash: ${Z}: ambiguous redirect
> >
> > I want to append all variables in X and Y into Z so
> that "echo $Z" should be:
> > XX1=YES XX2=YES YY1=YES YY2=YES
> >
> > I'm doing everything in command line not using any
> scripts.
> >
>
> That's not how you set a variable. Do it like this:
>
> Z="${X} ${Y}"
>
> You're mixing up variable initialisation with output to
> files.
Ok, this solves the issue. Thanks all for helping me in this regard.
Best regards
Unga
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?100376.63150.qm>
