1 |
Apparently, though unproven, at 17:47 on Wednesday 22 September 2010, Al did |
2 |
opine thusly: |
3 |
|
4 |
> >> grela@pazuzu ~ $ cat /etc/passwd | sed -n -e '4,10 p' |
5 |
> > |
6 |
> > Best solution so far, but useless use of cat, and the subshell overhead |
7 |
> > of the pipe. |
8 |
> |
9 |
> Thank you. Nice solutions and they reveal that there is no "belly" |
10 |
> like program in coreutils. |
11 |
> |
12 |
> I find it interesting, that the two bordercases are considered while |
13 |
> the general approach (range), that would cover all, is missing. Is |
14 |
> that rather for performance or for historical reasons? |
15 |
> |
16 |
> Al |
17 |
|
18 |
|
19 |
Neither. |
20 |
|
21 |
It's because one frequently wants to see the start or end of a file and much |
22 |
less seldom something in the middle. When that is what you want, there are all |
23 |
manner of other tools to find the bit you want, then display surrounding text. |
24 |
|
25 |
grep -{ABC} is the usual tool for that |
26 |
|
27 |
|
28 |
-- |
29 |
alan dot mckinnon at gmail dot com |