zsh-users
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@brasslantern.com>
To: Sweth Chandramouli <sweth@astaroth.nit.gwu.edu>,
	zsh-users@sunsite.auc.dk
Subject: Re: setopt and alias questions
Date: Mon, 8 Feb 1999 11:44:03 -0800	[thread overview]
Message-ID: <990208114403.ZM14493@candle.brasslantern.com> (raw)
In-Reply-To: <19990208141534.A4151@astaroth.nit.gwu.edu>

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


  reply	other threads:[~1999-02-08 19:47 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-02-08  0:37 Sweth Chandramouli
1999-02-08  1:59 ` Bart Schaefer
1999-02-08  4:52   ` Sweth Chandramouli
1999-02-08  7:33     ` Bart Schaefer
1999-02-08 15:30       ` Sweth Chandramouli
1999-02-08 18:45         ` Bart Schaefer
1999-02-08 19:15           ` Sweth Chandramouli
1999-02-08 19:44             ` Bart Schaefer [this message]
1999-02-08 19:59               ` Sweth Chandramouli
1999-02-08 20:55                 ` Bart Schaefer
1999-02-12 19:34                   ` Sweth Chandramouli
1999-02-12 20:13                     ` Bart Schaefer
1999-02-08 19:46             ` Sweth Chandramouli
1999-02-08 20:30               ` Bart Schaefer
1999-02-09  8:40                 ` Phil Pennock

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=990208114403.ZM14493@candle.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=sweth@astaroth.nit.gwu.edu \
    --cc=zsh-users@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).