Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Emulating 'locate'
- X-seq: zsh-users 6640
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Emulating 'locate'
- Date: Sat, 4 Oct 2003 22:40:16 +0000
- In-reply-to: <m3isn4ol1q.fsf@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20031001221753.GA23189@DervishD> <1031002023639.ZM22046@xxxxxxxxxxxxxxxxxxxxxxx> <20031002080358.GA23230@DervishD> <m365j6watm.fsf@xxxxxxxxxx> <20031004104844.GA50@DervishD> <m3oewxru4k.fsf@xxxxxxxxxx> <1031004163727.ZM28731@xxxxxxxxxxxxxxxxxxxxxxx> <m3isn4ol1q.fsf@xxxxxxxxxx>
On Oct 4, 3:33pm, Lloyd Zusman wrote:
}
} Based on this, it seems that zsh and 'find' are both maximally optimized
} with regard to recursive searching ... or at least the're both optimized
} equally well. :)
For certain searches, "find -depth" might actually be faster. Zsh always
does breadth-first globbing, even when asked to sort the final results
depth-first.
} > alias xlocate='noglob xlocate'
}
} Well, using this alias causes the argv indices to be off by one in the
} shell function: $0 becomes 'noglob', argv[1] becomes 'xlocate', etc.
If you're seeing that, then you've accidentally created a function named
"noglob" that has the same body as "xlocate". Try this:
alias foo='bar foo'
foo() { echo $0 }
functions bar
functions foo
Note that "foo()" is considered to be "in the command position" and thus
the alias expands and you get
bar foo () { echo $0 }
which defines two functions, "bar" and "foo" with identical bodies. I'd
wager that you created the alias, then changed the definition of xlocate,
and ended up with a function named "noglob".
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
Messages sorted by:
Reverse Date,
Date,
Thread,
Author