summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2025-05-09 08:43:21 -0300
committerEuAndreh <eu@euandre.org>2025-05-09 08:43:21 -0300
commit257b73065cc1dffd3bea567b69454409c67eca47 (patch)
tree2aa87b854ea20fb8d5e3645e62f7b3ffbc0b8c0e
parentsrc/urlid: Add working version, based on uuid(1) and xxxd(1) (diff)
downloadeut-257b73065cc1dffd3bea567b69454409c67eca47.tar.gz
eut-257b73065cc1dffd3bea567b69454409c67eca47.tar.xz
src/mandir: Accept more things as "section" of manpage
-rwxr-xr-xsrc/mandir6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mandir b/src/mandir
index c69ba6a..0b5060a 100755
--- a/src/mandir
+++ b/src/mandir
@@ -19,7 +19,7 @@ shift
ldirnames() {
find "$@" | xargs -I% basename % |
- sed 's|^\(.*\)\.\([a-z][a-z]\)\.\([0-9]\)$|\2/man\3|'
+ sed 's|^\(.*\)\.\([a-z][a-z]\)\.\(.*\)$|\2/man\3|'
}
dirnames() {
@@ -32,8 +32,8 @@ if [ "$ACTION" = 'install' ]; then
fi
for f in "$@"; do
- lang="$( printf '%s\n' "$f" | awk -F. '$0=$(NF - 1)')"
- section="$(printf '%s\n' "$f" | awk -F. '$0=$(NF)')"
+ lang="$( printf '%s\n' "$f" | cut -d. -f2)"
+ section="$(printf '%s\n' "$f" | cut -d. -f3-)"
name="$(basename "${f%."$lang"."$section"}")"
nameext="$name.$section"
case "$ACTION" in