From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26339 invoked by alias); 11 Oct 2012 12:39:30 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 17321 Received: (qmail 3494 invoked from network); 11 Oct 2012 12:39:28 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at bewatermyfriend.org does not designate permitted sender hosts) From: Frank Terbeck To: sergio Cc: zsh-users@zsh.org Subject: Re: dumb question about parameter expansion In-Reply-To: <5076B49A.90101@sergio.spb.ru> (sergio's message of "Thu, 11 Oct 2012 15:59:22 +0400") References: <5076B49A.90101@sergio.spb.ru> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) Date: Thu, 11 Oct 2012 14:20:35 +0200 Message-ID: <87zk3tgpyk.fsf@ft.bewatermyfriend.org> MIME-Version: 1.0 Content-Type: text/plain X-Df-Sender: [pbs]MzQ5NTM4 sergio wrote: > Looks like it's dumb question, but I can't understand this. > > % zsh -f > % l='ls' > % o='-l -h' > % $l $o > ls: invalid option -- ' ' > Try `ls --help' for more information. > > % ls -l -h > total 512 > drwxr-x--- 2 sergio sergio ... Zsh doesn't do wordsplitting of unquoted parameters (at least not by default, which is a good thing[tm]). Use an array instead: % o=(-l -h) % ls $o See as well. Regards, Frank -- In protocol design, perfection has been reached not when there is nothing left to add, but when there is nothing left to take away. -- RFC 1925