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

Function question



The following function example is given in an older copy of the zsh
introduction and I am wondering if it is wrong:

yp () {
	if (( $# == 0 ))
	then echo usage: yp name ...; fi
	for i; do ypmatch $1 passwd.byname; done
}

The document says that if nothing is passed to yp, it should do the echo
and exit, otherwise it should do the for loop.

To me it seems that if the number of arguments is zero, it should do the
echo and still attempt the for loop.  But, because there are no argument,
the for loop should produce nothing.

Am I missing something here?

MB
-- 
System Administrator - Extrel FTMS - Madison WI.
e-mail: brown@xxxxxxxx
phone: (608) 273-8262  fax: (608) 273-8719  voice-mail: (800) 426-6488 ext 6293
Visit - <http://www.cdsnet.net/vidiot/>  (Your link to the world of Star Trek)



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