]> git.ipfire.org Git - thirdparty/man-pages.git/blob - scripts/sortman
proc*.5: Make sashimi
[thirdparty/man-pages.git] / scripts / sortman
1 #!/bin/sh
2
3 # Copyright 2023, Alejandro Colomar <alx@kernel.org>
4 # SPDX-License-Identifier: GPL-3.0-or-later
5
6 sed -E '/\/intro./ s/.*\.([[:digit:]])/\10\t&/' \
7 | sed -E '/\/intro./! s/.*\.([[:digit:]])\>/\11\t&/' \
8 | sed -E '/\/intro./! s/.*\.([[:digit:]])([[:alpha:]][[:alnum:]]*\>)/\12.\2\t&/' \
9 | sed -E ' s/\t(.*)/&\n\1/' \
10 | sed -E '/\t/ s/\/[_-]*/\//g' \
11 | sed -E '/\t/ s/[_-]/_/g' \
12 | sed -E '/\t/ {N;s/\n/\t/;}' \
13 | sort -fV \
14 | cut -f3;