diff options
| author | linear <dev@linear.network> | 2021-09-05 01:03:36 -0700 |
|---|---|---|
| committer | Felix Queißner <felix@ib-queissner.de> | 2021-09-05 11:04:23 +0200 |
| commit | e07c8eb599c9fc0f77c7a6f0643a786b751796b4 (patch) | |
| tree | cf13273eaa7ba0d46454f89eb637275223f2f34e /doc | |
| parent | 0a8ecd6223e25e8125477093ecc2c87fdd369767 (diff) | |
doc/gen-man.sh: head and tail +/- syntax is not portable
the + and - syntax on head and tail are only present, as far as i know,
in GNU coreutils, and are not present on any other UNIX or BSD systems.
this patch replaces those with a more portable processing chain, which
is tested to work on GNU coreutils, NetBSD, macOS, and busybox.
Diffstat (limited to 'doc')
| -rwxr-xr-x | doc/gen-man.sh | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/doc/gen-man.sh b/doc/gen-man.sh index 5b8ad18..8391c73 100755 --- a/doc/gen-man.sh +++ b/doc/gen-man.sh @@ -54,8 +54,7 @@ gem_in=$( cat "$gemtext_in" | # Strip a few lines from beginning/end of file. - tail -n +9 | - head -n -9 | + nl | awk 'FNR > 9' | sort -nr | awk 'FNR > 9' | sort -n | cut -f 2- | # First expression replaces all [Text like this] with bold text. # Second expression replaces text like *This* or _this_ with italic text. |
