From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 872 invoked from network); 8 Feb 1999 19:47:15 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 8 Feb 1999 19:47:15 -0000 Received: (qmail 4710 invoked by alias); 8 Feb 1999 19:46:00 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 2120 Received: (qmail 4678 invoked from network); 8 Feb 1999 19:45:44 -0000 From: "Bart Schaefer" Message-Id: <990208114403.ZM14493@candle.brasslantern.com> Date: Mon, 8 Feb 1999 11:44:03 -0800 In-Reply-To: <19990208141534.A4151@astaroth.nit.gwu.edu> Comments: In reply to Sweth Chandramouli "Re: setopt and alias questions" (Feb 8, 2:15pm) References: <19990207193735.A2060@astaroth.nit.gwu.edu> <990207175931.ZM8940@candle.brasslantern.com> <19990207235214.A2653@astaroth.nit.gwu.edu> <990207233343.ZM10079@candle.brasslantern.com> <19990208103038.A3447@astaroth.nit.gwu.edu> <990208104550.ZM14297@candle.brasslantern.com> <19990208141534.A4151@astaroth.nit.gwu.edu> X-Mailer: Z-Mail (4.0b.820 20aug96) To: Sweth Chandramouli , zsh-users@sunsite.auc.dk Subject: Re: setopt and alias questions MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Feb 8, 2:15pm, Sweth Chandramouli wrote: } Subject: Re: setopt and alias questions } } On Mon, Feb 08, 1999 at 10:45:50AM -0800, Bart Schaefer wrote: } > } > autoload $^fpath/*(.:t) } i don't like error messages, however, so i use the loop to test } for the existance of autoloadable files before doing the actual autoload: } } for DIRNAME in ${fpath} ; do } if [[ -x ${DIRNAME}/*(.x:t) ]] ; then } autoload ${DIRNAME}/*(.x:t) } fi; } done; That loop will never autoload anything -- unless there happens to be a file in the current directory with the same name as one in ${DIRNAME}. Do you see why? Once that's fixed, the [[ -x ... ]] is completely redundant with *(.x) -- it always succeeds, unless *(.x) doesn't match any files. (Is that the error you're worried about?) Finally, there's no requirement that files have the execute mode set in order to be autoloadable, so using (x) may miss some. } > What two characters, inserted twice, give the same effect in 3.0.5? } :s, which makes me wonder why the ${param/pattern/replacement} } construct was added at all. The patterns in ${param/pattern/replacement} can contain glob characters which are matched against the value of $param, but the "patterns" in ${param:s/pattern/replacement} are matched as literal strings without globbing. The older :s form is borrowed from csh, the newer form is from (I think) bash. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com