[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Feature suggestion: sort --skip-header-lines=N (and perhaps --skip-t
From: |
Stephane Chazelas |
Subject: |
Re: Feature suggestion: sort --skip-header-lines=N (and perhaps --skip-trailer-lines?) |
Date: |
Mon, 26 Oct 2015 15:30:48 +0000 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
2015-10-26 11:40:54 +0000, Pádraig Brady:
[...]
> Summary is you can do this with GNU sed:
>
> ( echo 99 ; seq 10 ) | ( sed -u 1q ; sort -n )
[...]
Or POSIXly:
awk 'NR <= 3 {print; next}; {print | "sort -n"}'
Or:
(IFS= read -r line && printf '%s\n' "$line"; sort -n)
On systems that still have the "line" utility:
(line; sort -n)
--
Stephane