Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: setopt and alias questions

On Mon, Feb 08, 1999 at 10:45:50AM -0800, Bart Schaefer wrote:
> } > } aside from global aliases, is there any reason
> } > } to not put all of my aliases into equivalent functions?
> } > 
> } > Probably not.  (Functions aren't exported either, though.)
> } 	no, but they can be dropped in a .zfunc folder, so that
> } only an autoload loop needs to be put in .zshrc for all shells to
> } have access to them. 
> You don't even need a loop.
> 	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)

> Can you figure out what this is doing?  
	what my modulo2 binary-value loop did much more painfully.

> (Not terribly obfuscated, I admit.)
> 	ov=${(L)${${ov/on/OFF}/off/on}}
> BTW, that works only in 3.1.5-pws-something.  Exercise for the reader:
> 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.

Sweth Chandramouli
IS Coordinator, The George Washington University
<sweth@xxxxxxx> / (202) 994 - 8521 (V) / (202) 994 - 0458 (F)
<a href="http://astaroth.nit.gwu.edu/~sweth/disc.html";>*</a>

Messages sorted by: Reverse Date, Date, Thread, Author