bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC] linecut addition


From: Steven Schubiger
Subject: Re: [RFC] linecut addition
Date: Tue, 9 Oct 2007 18:07:07 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

Jim Meyering <address@hidden> wrote:

> That's a good start, but please elaborate on the following, too:
> 
> What if ranges overlap?
> I.e., --range 1,5:4,8

$ seq 10 | linecut --range 1,5:4,8
1
2
3
4
5
4
5
6
7
8

> Bear in mind that with an EOF-relative endpoint,
> we can't even know whether two ranges overlap until
> after reading to end of file.

Yes, true.

> What if one range is contained within another?

Something like 

$ seq 10 | linecut --range 1,5:2,4
1
2
3
4
5
2
3
4

?

> What if they are out of order, e.g. --range 4,7:1,3 ?

$ seq 10 | linecut --range 4,7:1,3
4
5
6
7
1
2
3

> You don't say whether line numbering restarts with multiple input files.
> I presume not, but the spec/manual should specify.

The line numbering is unique to each input file.

> A note about notation.  I'm used to seeing ":" or "-" between
> the endpoints of a range, not ",".  "," is more often the separator
> *between* ranges.  Please consider using a more conventional notation.

Would `linecut --range 1:2,3:4,-100:-1` be considered sensible?

Concerning the example outputs above, I'm not saying that I'm confident 
that they make sense at all. It's just how the current implementation is.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]