How to say this in Bash?

Peter Steele psteele at webmail.maxiscale.com
Mon May 25 16:17:41 UTC 2009


>$ 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

Redirection is not the right way to do it. Just do this:

$ Z="$X $Y"

$ echo $Z
XX1=YES XX2=YES YY1=YES YY2=YES



More information about the freebsd-questions mailing list