coreutils
[Top][All Lists]
Advanced

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

Enhancement Request: sort: skip table caption (or just a specified numbe


From: Michael Mess
Subject: Enhancement Request: sort: skip table caption (or just a specified number of lines)
Date: Thu, 5 Nov 2020 18:23:50 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

I have a feature request for the sort command:
I would like to sort a table but do not want to sort the column names a
the top. Thus the column names or a specified number of lines should be
just given out as they are, unsorted.

Example: Sort also sorts the caption ("ColumnName"):

michael@thinkpad:~$ for a in ColumnName 4 2 3 1 ; do echo $a ;done
ColumnName
4
2
3
1
michael@thinkpad:~$ for a in ColumnName 4 2 3 1 ; do echo $a ;done |sort
1
2
3
4
ColumnName
michael@thinkpad:~$


# Actual:

michael@thinkpad:~$ for a in ColumnName 4 2 3 1 ; do echo $a ;done |sort
--caption
sort: Unbekannte Option »--caption«
„sort --help“ liefert weitere Informationen.
michael@thinkpad:~$


# Expected:

michael@thinkpad:~$ for a in ColumnName 4 2 3 1 ; do echo $a ;done |sort
--caption
ColumnName
1
2
3
4
michael@thinkpad:~$


I know there is a workaround, but this is not so handy/comfortable and
has other disadvantages:

for a in ColumnName 4 2 3 1 ; do echo $a ;done | ( sed -u 1q ; sort -n )




reply via email to

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