From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11025 invoked from network); 14 Mar 2004 18:55:04 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 14 Mar 2004 18:55:04 -0000 Received: (qmail 26368 invoked by alias); 14 Mar 2004 18:54:43 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7174 Received: (qmail 26274 invoked from network); 14 Mar 2004 18:54:43 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 14 Mar 2004 18:54:43 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [167.160.213.139] by sunsite.dk (MessageWall 1.0.8) with SMTP; 14 Mar 2004 18:54:42 -0000 Received: from moonbase.zanshin.com (IDENT:schaefer@localhost [127.0.0.1]) by moonbase.zanshin.com (8.12.11/8.12.11) with ESMTP id i2EIsfSv003928 for ; Sun, 14 Mar 2004 10:54:41 -0800 Received: (from schaefer@localhost) by moonbase.zanshin.com (8.12.11/8.12.11/Submit) id i2EIsf9g003927 for zsh-users@sunsite.dk; Sun, 14 Mar 2004 10:54:41 -0800 Received: (from schaefer@localhost) by candle.brasslantern.com (8.11.6/8.11.6) id i2EIsbJ06793; Sun, 14 Mar 2004 10:54:37 -0800 X-Authentication-Warning: candle.brasslantern.com: schaefer set sender to schaefer@closedmail.com using -f From: Bart Schaefer Message-Id: <1040314185437.ZM6792@candle.brasslantern.com> Date: Sun, 14 Mar 2004 18:54:37 +0000 In-Reply-To: Comments: In reply to Thorsten Kampe "Re: named directory expansion on strings" (Mar 13, 6:48pm) References: <1040313064100.ZM28748@candle.brasslantern.com> X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-users@sunsite.dk Subject: Re: named directory expansion on strings MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Envelope-Sender: On Mar 13, 6:48pm, Thorsten Kampe wrote: : : Fortunately, I found a better way[1]. Any style comments on my first : /really complicated/ ;-) zsh shell script welcome! Nothing major ... : | for file in /etc/profile.d/zshell.zsh \ : | /etc/zsh/zprofile \ : | /etc/zprofile \ : | ~/.zsh/.zlogin \ : | ~/.zsh/.zshrc \ : | ~/.zshenv : | do ... : | done If you want to list every name on its own line like that, you might try the parenthesized list syntax: for file ( /etc/profile.d/zshell.zsh /etc/zsh/zprofile /etc/zprofile ~/.zsh/.zlogin ~/.zsh/.zshrc ~/.zshenv ) do ... done Not compatible with non-zsh shells, of course. Also works with the word "foreach", in which case you may omit the "do" and replace "done" with "end" (syntax stolen from csh). : | print ${(r.$JUSTIFY.):-"${ltred}! ${white}..." You don't need $JUSTIFY there: (r.JUSTIFY.) is sufficient, because the expression is interpreted in math context where all non-keywords are variable references. : Long live the Zen of Python[2]. Hrm. As far as I'm concerned, the Python folks went wrong when they gave semantic significance to depth of whitespace indentation, and all of the right decisions they've made since have been a waste of effort.