Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] Fix hexdump command used for mercurial dirstate parsing
- X-seq: zsh-workers 39782
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: [PATCH] Fix hexdump command used for mercurial dirstate parsing
- Date: Sun, 30 Oct 2016 11:28:32 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=rZQHOuzpPYVzL4do6Ns3T6Ce2EkLqv9ZSb80RZrjHhM=; b=gRI8r3/m2UmBNyXgstsGrDkDBIgEE8MgVRQgAKka/2dD3KMXX2D090GxWcEQ9Pm8FK VxdJrcQA2l8lbKYoUmFzXjiRlvhFxfPADfEqYM6iu3o9ptvf+etQJt6qA7qdNZhvAHgB rywDRsB7+MdW2krK2WOiuT2WpFkdi3EAuivA9LvghDfoAGzcDSgIPJMDgEk0B/Uw5OwR ULo2apDnHmgtK6uun+h+s72qtpcypGsMSpTyMYkQI69UeR8U/gy9XV98hFswLBdlOQNZ 19LbRCOQaHCmp4F1ovUvUegix96npu1a17WQaHN8IjcTQkqfvZoRelphL5AlVGeklWte sv9g==
- In-reply-to: <20161030170534.GA17437@fujitsu.shahaf.local2>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20161030024723.62832-1-john.reed.riley@gmail.com> <87y416drcq.fsf@ft.bewatermyfriend.org> <20161030155530.GC12137@fujitsu.shahaf.local2> <20161030170534.GA17437@fujitsu.shahaf.local2>
On Oct 30, 5:06pm, Daniel Shahaf wrote:
}
} setopt localoptions extendedglob
} local -r -A pad=( $'\0' 0 $'\1' 0 $'\2' 0 $'\3' 0 $'\4' 0 $'\5' 0 $'\6' 0 $'\7' 0 $'\10' 0 $'\11' 0 $'\12' 0 $'\13' 0 $'\14' 0 $'\15' 0 $'\16' 0 $'\17' 0 )
} REPLY=${(L)val//(#b)(?)/$pad[$match[1]]$(( [##16] ##${match[1]} ))}
I can't help thinking here must be an easier way to do that.
f() {
setopt localoptions nomultibyte extendedglob
local val
read -k $2 -u 0 val <$1
print -r -- ${(Lj::)${(l:2::0:)${(@s//)val}//(#m)*/$(( [##16] ##$MATCH ))}}
}
--
Barton E. Schaefer
Messages sorted by:
Reverse Date,
Date,
Thread,
Author