On 20 Dec 2010 09:14:55 -0500, Assaf Gordon wrote:
> 
> And as I've mentioned, sooner or later a patch will be accepted
> that will add this feature to sort, rendering my script obsolete.

I think your "sort --header N" addition can be useful for some cases,
but in practice I don't think I miss such option too much. BTW, why
no "--footer N" for completeness then?

I would rather just have "--ignore-first-lines N" without preserving
these lines in the output. I don't mind to specify two options
"--header N --skip-header" for this instead, but it can be confusing.

Actually, I always wondered why noone felt a need to add dozens of
useful (well designed) options like these to core utilities ages ago.
Personally my scripts (mostly in perl) have options for many life
cases. I think I know why, besides the obvious "be minimalistic and
clean" approach. In perl you don't care about performance too much,
so adding dozens of options (many of which can and should conflict
with each other) is so easy.

About 15 years ago I wanted to patch head(1) and maybe tail(1) too
to support something like "--ignore-first-lines N", because this is a
so frequent task. Just like you want to get the first or last 2 lines
(head/tail -2) you may want to get all but the first or last 2 lines.
But I never had a time and a strong need to complete this. I wish you
success in patching GNU utilities, and not just "sort".

Now some comments about your wrapper. The lastest "sort" version has
more options, like "--random-sort", "--batch-size", "--parallel".
Using AGPL and not GPL for command line utilities is not justified.
And "sort" also supports fancy option "+2 -3" (sort by third field).
For this I suggest just to filter @ARGV before you call GetOptions.

Regards,
Mikhael.

-- 
perl -e 'print+chr(64+hex)for+split//,d9b815c07f9b8d1e'
_______________________________________________
Perl mailing list
[email protected]
http://mail.perl.org.il/mailman/listinfo/perl

Reply via email to