Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 May 2009 18:20:58 +0100
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        Unga <unga888@yahoo.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: How to say this in Bash?
Message-ID:  <4A1AD37A.5030003@infracaninophile.co.uk>
In-Reply-To: <904563.63141.qm@web57001.mail.re3.yahoo.com>
References:  <904563.63141.qm@web57001.mail.re3.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <gesbbb@yahoo.com> wrote:
>=20
>> 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?
>>
>=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--



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