Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Emulating 'locate'
- X-seq: zsh-users 6627
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxxxxx>
- Subject: Re: Emulating 'locate'
- Date: Thu, 2 Oct 2003 14:29:27 +0000
- In-reply-to: <20031002080358.GA23230@DervishD>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20031001221753.GA23189@DervishD> <1031002023639.ZM22046@xxxxxxxxxxxxxxxxxxxxxxx> <20031002080358.GA23230@DervishD>
On Oct 2, 10:03am, DervishD wrote:
}
} > For that you have to use brace expansion, because you can't mix **/ and
} > any other form of alternation:
}
} Didn't know about the mixing...
To be precise, you can't express "this file pattern OR this hierarchy"
with (pat1|pat2) syntax. The alternate patterns can't contain slashes.
That leaves using brace expansion to express "this file pattern" and
"this hierarchy" as separate patterns.
Which reminds me ... instead of this:
} > locate() { print -l /**/*${^*}*{,/**/*} }
You might want:
locate() {
setopt localoptions nullglob nocshnullglob
print -l /**/*${^*}*{,/**/*}
}
Do you see why?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author