From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 414 invoked from network); 25 Jan 2005 14:54:29 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 25 Jan 2005 14:54:29 -0000 Received: (qmail 8455 invoked from network); 25 Jan 2005 14:54:23 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 25 Jan 2005 14:54:23 -0000 Received: (qmail 26267 invoked by alias); 25 Jan 2005 14:53:48 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8427 Received: (qmail 26253 invoked from network); 25 Jan 2005 14:53:48 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 25 Jan 2005 14:53:48 -0000 Received: (qmail 6600 invoked from network); 25 Jan 2005 14:53:08 -0000 Received: from mailhost1.csr.com (HELO MAILSWEEPER01.csr.com) (81.105.217.43) by a.mx.sunsite.dk with SMTP; 25 Jan 2005 14:53:05 -0000 Received: from exchange03.csr.com (unverified [10.100.137.60]) by MAILSWEEPER01.csr.com (Content Technologies SMTPRS 4.3.12) with ESMTP id for ; Tue, 25 Jan 2005 14:51:42 +0000 Received: from news01.csr.com ([10.103.143.38]) by exchange03.csr.com with Microsoft SMTPSVC(5.0.2195.6713); Tue, 25 Jan 2005 14:52:46 +0000 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.13.1/8.12.11) with ESMTP id j0PEr3GS024181 for ; Tue, 25 Jan 2005 14:53:03 GMT Received: from csr.com (pws@localhost) by news01.csr.com (8.13.1/8.13.1/Submit) with ESMTP id j0PEr3bo024178 for ; Tue, 25 Jan 2005 14:53:03 GMT Message-Id: <200501251453.j0PEr3bo024178@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: zsh-users@sunsite.dk Subject: Re: Expansion order In-reply-to: <20050125144150.GP29543@suse.de> References: <20050125144150.GP29543@suse.de> Date: Tue, 25 Jan 2005 14:53:03 +0000 From: Peter Stephenson X-OriginalArrivalTime: 25 Jan 2005 14:52:46.0845 (UTC) FILETIME=[886062D0:01C502ED] X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.3 required=6.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.3 Mads Martin Joergensen wrote: > Hey together, > > $ export LS_OPTIONS="-N --color=tty -T 0" > $ alias ls='ls $LS_OPTIONS' > $ ls > /bin/ls: invalid option -- > Try `/bin/ls --help' for more information. > > How come the zsh is doing the expansion in this case differently from > csh, tcsh, bash and sh? It's sh_word_split again. You're using $LS_OPTIONS as a single word and zsh is obliging. The error message is confusing. There are various possibilities: alias ls="ls $LS_OPTIONS" is the simplest, but if you want changes in LS_OPTIONS to be reflected later on you need something else. alias ls='ls $=LS_OPTIONS' is the obvious. More sophisticated: typeset -xT LS_OPTIONS="-N --color=tty -T 0" ls_options alias ls='ls $ls_options' This allows for whitespace characters in the options as long as you manipulate them through the array ls_options. -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070 ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **********************************************************************