From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9863 invoked from network); 12 Feb 1999 19:36:16 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 12 Feb 1999 19:36:16 -0000 Received: (qmail 26487 invoked by alias); 12 Feb 1999 19:35:19 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 2134 Received: (qmail 26476 invoked from network); 12 Feb 1999 19:35:17 -0000 Date: Fri, 12 Feb 1999 14:34:25 -0500 From: Sweth Chandramouli To: zsh-users@sunsite.auc.dk Subject: Re: setopt and alias questions Message-ID: <19990212143425.A23452@astaroth.nit.gwu.edu> Mail-Followup-To: zsh-users@sunsite.auc.dk 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> <990208114403.ZM14493@candle.brasslantern.com> <19990208145928.C4151@astaroth.nit.gwu.edu> <990208125500.ZM14738@candle.brasslantern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95i In-Reply-To: <990208125500.ZM14738@candle.brasslantern.com> On Mon, Feb 08, 1999 at 12:55:00PM -0800, Bart Schaefer wrote: > On Feb 8, 2:59pm, Sweth Chandramouli wrote: > } Subject: Re: setopt and alias questions > } > } On Mon, Feb 08, 1999 at 11:44:03AM -0800, Bart Schaefer wrote: > } > On Feb 8, 2:15pm, Sweth Chandramouli wrote: > } > } > } > } 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? > } yes--because i need to start cut&pasting my functions rather > } than typing them in. that should be -n, not -x. > > That won't work either (and my remark about "unless there happens to be a > file in the current directory" is wrong as well). Filename generation is > not applied to the strings inside the [[ ... ]]. are you sure about this? the above (with -n instead of -x) works fine for me--or at least, the filename generation part does. what i hadn't realized until now is that the error i was trying to catch, about there not being any matches for that glob, was being generated by the shell instead of the autoload command; any dirs in fpath that don't contain executable files, then, would cause the shell to return the same error when attempting the glob in the [[ ... ]], which defeats the purpose of the entire loop. (globbing in the test operator _definitely_ does work, however.) could a flag be added to the list of glob qualifiers that says "if no matches are found, quietly return nothing but a non-zero exit status"? i think "q" (for "quiet") is still free. -- sweth. -- Sweth Chandramouli IS Coordinator, The George Washington University / (202) 994 - 8521 (V) / (202) 994 - 0458 (F) *