From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2310 invoked from network); 18 Oct 1997 07:30:07 -0000 Received: from math.gatech.edu (root@130.207.146.50) by ns1.primenet.com.au with SMTP; 18 Oct 1997 07:30:07 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id CAA29224; Sat, 18 Oct 1997 02:10:50 -0400 (EDT) Resent-Date: Sat, 18 Oct 1997 02:09:36 -0400 (EDT) Message-Id: In-Reply-To: <971017084433.ZM7615@candle.brasslantern.com> References: <199710170925.KAA05948@taos.demon.co.uk> <199710170925.KAA05948@taos.demon.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Sat, 18 Oct 1997 02:09:45 -0400 To: zsh-users@math.gatech.edu From: Sweth Chandramouli Subject: Re: for syntax differences from ksh Resent-Message-ID: <"YRJSd1.0.R77.VA5Iq"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1089 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu At 11:44 AM -0400 on 10/17/97, Bart Schaefer wrote: > On Oct 17, 10:25am, Andrew Main wrote: > } Subject: Re: for syntax differences from ksh > } > } Sweth Chandramouli wrote: > } > > } >addpath () { > } >for pathdir in $*; do > } > if test -d $pathdir; then > } > PATH=$PATH:$pathdir > } > fi; > } >done > } >} > } > } This function is correct for zsh. > > Yes, but I'd recommend > > PATH=${PATH}:$pathdir > > because of zsh's `:' variable modifiers. It happens to work here because > zsh ignores the `:' when it is not followed by a recognized modifier, but > I think it's a bad habit to rely upon that. in a search for a better habit: is it then always correct to enclose the variable name in braces? i remember being told at some point not to do so, though i think that was for a different shell altogether. (thanks to everyone who explained the word splitting problem; as soon as the first person pointed it out, i remembered reading it in the faq. doh!) -- sweth