Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: variable problem
- X-seq: zsh-workers 5946
- From: Bruce Stephens <B.Stephens@xxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: Re: variable problem
- Date: 25 Mar 1999 17:03:09 +0000
- In-reply-to: Thomas Ziehmer's message of "Thu, 25 Mar 1999 18:08:42 +0100"
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
- References: <19990325180842.C5507@xxxxxxxxxxxxxxxxxxxxx>
- Sender: B.Stephens@xxxxxxxxx
Thomas Ziehmer <ziehmer@xxxxxxxxxxxxxx> writes:
> I got into the following problem (only tested on zsh-3.1*)
>
> thomas@digger [thomas]> a='echo x'
> thomas@digger [thomas]> echo $a
> echo x
> thomas@digger [thomas]> $a
> zsh: command not found: echo x
>
> The correct output would be 'x'. I get the correct output in other shells
> (sh,ksh,bash).
No, you get the incorrect output in other shells. This is the famous
SHWORDSPLIT issue mentioned in the FAQ (which says that all other
shells are broken).
If you use
% a=(echo x)
instead, then things will work as you want. Or setopt SHWORDSPLIT, or
use whatever magic it is to do SHWORDSPLIT on expansion (the $a line).
Messages sorted by:
Reverse Date,
Date,
Thread,
Author