[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Quilt-dev] gawk 3.0.6 doesn't support asort
From: |
Andreas Gruenbacher |
Subject: |
Re: [Quilt-dev] gawk 3.0.6 doesn't support asort |
Date: |
Tue, 6 Sep 2005 00:25:12 +0200 |
User-agent: |
KMail/1.7.1 |
On Monday 05 September 2005 23:00, Jean Delvare wrote:
> I have written a different replacement which continues to use awk
> instead. I plan to commit it if nobody objects. It is appended to this
> post, comments and testers welcome. Basically the idea is to sort the
> list beforehand (using the sort Unix command), pass a sorted list to awk
> and get the awk script to simply preserve this input order.
Nice.
> [...]
> > END {
> - i = 1
> - for (file in files) {
> - if (!(file in printed)) {
> - new_files[i]=file
> - i++
> - }
> - }
> - n = asort(new_files)
> for (i=1; i<=n; i++)
"i<=n" needs to be changed to "i in new_files" as well, and new_files also
should be removed completely.
> - print new_files[i]
> + if (!(new_files[i] in printed))
> + print new_files[i]
> }
> '
> }
Thanks,
Andreas.