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: Sat, 6 Oct 2007 22:57:25 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

Jim Meyering <address@hidden> wrote:

> Before coding further, I strongly urge you to nail down the
> specification -- publicly.  Put it this way: write enough
> details that someone reading your description in a man page
> would not be disappointed.

DESCRIPTION

linecut extracts slices of lines from either a file/stream 
or multiple files. 

The required range parameter provided must consist of at 
least one pair of a line slice, where the line to 
start from preceeds the comma and the line to end 
at follows the comma. The line specified may be absolute 
counting from the beginning of the file (positive number) 
or relative to the end (negative number). Absolute and 
relative line positions may be intermixed.

If more than one pair of a line slice is provided, then
the pairs must be separated by a colon.

The line-numbering parameter works similar to cat and
is optional.

EXAMPLES

(line 2-5)
$ seq 10 | linecut --range 2,5
2
3
4
5

(line 2-2nd last line)
$ seq 10 | linecut --range 2,-2
2
3
4
5
6
7
8
9

(6th last line-2nd last line)
$ seq 10 | linecut --range -6,-2
5
6
7
8
9

(line 2-4, 3rd last line-last line)
$ seq 10 | linecut --range 2,4:-3,-1
2
3
4
8
9
10

I've omitted the line-numbering examples, since the 
line numbers printed would equal the extracted sequences.





reply via email to

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