Steven Schubiger wrote:
Matthew Woehlke <mw_triad.NO.SPAM.PLEASE> wrote:
Do you plan to have a means of specifying a number of lines? E.g.:
$ seq 10 | linecut --range 5,+3
5
6
7
I like the idea. And it should be rather easy to calculate the
ending line position.
Well, yes, I would hope so. If you can't write 'a + b' in your program,
something is wrong ;-). (Use case is of course e.g. scripts where the
beginning line is not known in advance, but you know you want N lines
total.)
I hope the distinction between the '-' & '+'
"prefixes" would be clear enough.
'-N' is already a fairly common convention, so I don't expect problems.
And I stole '+N' from sed, of course :-).
Btw, how do you match 5 through end? '5,-0'?
Yes.
Ok. (An alternative, if sed-like format wins, would of course be '5,$',
but '5,-0' is fine.)
What does a reversed range (e.g. '5,2') match?
That shouldn't be allowed. Or should it?
I was asking you :-). Personally I think printing lines backwards is
probably not so good an idea, so I would either match only the first
line, or else print a warning to stderr. Anyway '5,2' was just an
"obvious" example; I would expect this to be more likely with a range
like '5,-5' on input with fewer than nine lines.
--
Matthew
morphir: so much confusion :S kmake, kdemake, qmake make cmake etc.
logixoul: you forgot cmakekde :)
morphir: and bakemeacake
_______________________________________________
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils