Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Extended attributes (module and article)
- X-seq: zsh-users 16727
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Micah Elliott <mde@xxxxxxxxxxxxxxxx>
- Subject: Re: Extended attributes (module and article)
- Date: Wed, 11 Jan 2012 22:00:49 +0100
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=upv2iTujG6KQQXTLzzdj+TjCwsV+cQB50bOvbLTkSP8=; b=i09SgNP5tsiGlAp5mpR2xyW4BMU9vQuY3PnooHnjHDvIwavmCoGQAtYMFQqiRC4iW+ w9c4CYIbJQyi7JDya15Z9t2CoO2uM+Ndywj5BuYVpjbgmp2IiIh1Fi8fBywSaCC2/VKu n/S1GfbJeO1AVWloLwJB2UCPw52/u+J/gFmcY=
- In-reply-to: <CAELbujr2UtYM3B4UP+0EU+1ba6ePjx9S7bpy2Ahct1LwMTA5Uw@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAELbujr2UtYM3B4UP+0EU+1ba6ePjx9S7bpy2Ahct1LwMTA5Uw@mail.gmail.com>
On 11 January 2012 21:52, Micah Elliott <mde@xxxxxxxxxxxxxxxx> wrote:
> Hi! I was peeking at the `zsh/attr` module docs and trying to figure
> out why it exists. Is it significantly different from the standard
> getfattr/setfattr/attr utils (which already have nice completions and
> look more featureful)? Does it serve to abstract say Linux's xattr and
> Mac's xattr systems? I'm really only using Linux, but I guess that
> could be a reason to use the zsh module.
I wrote it for use with the *(e::) globbing syntax, where calling out
to an external binary for hundreds/thousands of files is just way way
too slow. eg
#usage, *(e:fattr name:) or *(e:fattr name value:)
function fattr() {
local val
zgetattr $REPLY user.$1 val 2>/dev/null
[[ -n "$val" && ( -z "$2" || "$val" =~ "$2" ) ]]
}
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author