Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Excluding files & directories from a glob
- X-seq: zsh-users 9478
- From: Jean Chalard <jean.chalard@xxxxxxxxx>
- To: zzapper <david@xxxxxxxxxx>
- Subject: Re: Excluding files & directories from a glob
- Date: Thu, 6 Oct 2005 18:10:53 +0900
- Cc: zsh-users@xxxxxxxxxx
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=KnLTMH12ixK3zLUNtAnAww/TuhBljbCAn69cFmWIS28MCBfsCOH4CifMCP6DxWnK80xDkGB9HRezZq+44aMeAgYI5zK6FYCGZMsEoMWOvSM4n84TtHthRhEO1B3FQNd+W/kXYJws4AHWcBB7j4unI0qjLPffUsuQRoe0qVfoMcg=
- In-reply-to: <opp9k11dhp0stkp1dffh9dqmviairhcr2b@xxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <t495k1hltml46t91vsedbah8n6h2knijgg@xxxxxxx> <20051004171438.4165d915.pws@xxxxxxx> <b5i5k1pqbrp6cibu2bcp16m7gpgq3hb4mr@xxxxxxx> <fb6be96e0510042001v2ccae4b4ha368452509e3d274@xxxxxxxxxxxxxx> <opp9k11dhp0stkp1dffh9dqmviairhcr2b@xxxxxxx>
- Reply-to: Jean Chalard <jean.chalard@xxxxxxxxx>
> >> > grep -i 'host' **/(*.cfm~(ctpigeonbot|env).cfm)~*((#s)|/)junk*/*(.)
>
> Ok I give in what does the qualifier #s mean and do, and where is it in the doc.
The #s qualifier matches the start of a string. In the manual you can find its
description on the "13.8 Filename generation" section, under 13.8.4 :
globbing flags.
Here is the relevant chunk of documentation :
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
s, e
Unlike the other flags, these have only a local effect, and each
must appear on its own: `(#s)' and `(#e)' are the only valid
forms. The `(#s)' flag succeeds only at the start of the test
string, and the `(#e)' flag succeeds only at the end of the test
string; they correspond to `^' and `$' in standard regular
expressions. They are useful for matching path segments in
patterns other than those in filename generation (where path
segments are in any case treated separately). For example,
`*((#s)|/)test((#e)|/)*' matches a path segment `test' in any of
the following strings: test, test/at/start, at/end/test,
in/test/middle.
Another use is in parameter substitution; for example
`${array/(#s)A*Z(#e)}' will remove only elements of an array which
match the complete pattern `A*Z'. There are other ways of
performing many operations of this type, however the combination
of the substitution operations `/' and `//' with the `(#s)' and
`(#e)' flags provides a single simple and memorable method.
Note that assertions of the form `(^(#s))' also work, i.e. match
anywhere except at the start of the string, although this actually
means `anything except a zero-length portion at the start of the
string'; you need to use `(""~(#s))' to match a zero-length
portion of the string not at the start.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
--
J
"If you wish to leave a record of your call,
please state your messij at the sound of the tone."
Messages sorted by:
Reverse Date,
Date,
Thread,
Author