`LC_COLLATE=en_US.UTF-8` is needed to collate pages like _exit(3) next
to exit(3), instead of having all pages with a leading underscore
grouped at the beginning of a section.
intro(*), of course, is the fist page of each section, and subsections
go after the last page in the main corresponding section.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
--- /dev/null
+#!/bin/sh
+
+# Copyright 2023, Alejandro Colomar <alx@kernel.org>
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+export LC_COLLATE=en_US.UTF-8;
+
+sed -E '/\/intro./ s/.*\.([1-8])$/\10\t&/' \
+| sed -E '/\/intro./!s/.*\.([1-8])$/\11\t&/' \
+| sed -E '/\/intro./!s/.*\.([1-8].+)/\1\t&/' \
+| sort \
+| cut -f2;