File: sortman

package info (click to toggle)
manpages 6.9.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 19,808 kB
  • sloc: sh: 503; python: 222; perl: 165; makefile: 27; lisp: 22
file content (15 lines) | stat: -rwxr-xr-x 559 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh

# Copyright 2023, Alejandro Colomar <alx@kernel.org>
# SPDX-License-Identifier: GPL-3.0-or-later

sed   -E '/\/intro./  s/.*\.([[:digit:]])/\10\t&/' \
| sed -E '/\/intro./! s/.*\.([[:digit:]])\>/\11\t&/' \
| sed -E '/\/intro./! s/.*\.([[:digit:]])([[:alpha:]][[:alnum:]]*\>)/\12.\2\t&/' \
| sed -E '            s/\t(.*)/&\n\1/' \
| sed -E '/\t/        s/\.[[:digit:]]([[:alpha:]][[:alnum:]]*)?\>.*//' \
| sed -E '/\t/        s/\/[_-]*/\//g' \
| sed -E '/\t/        s/[_-]/ /g' \
| sed -E '/\t/        {N;s/\n/\t/;}' \
| sort -fV -k1,2 \
| cut -f3;