summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2026-03-08 21:16:13 +0100
committerThomas Voss <mail@thomasvoss.com> 2026-03-08 21:16:13 +0100
commitac758e0d72ce34678d28a653ea0afc2bb8079713 (patch)
tree3c9908be2b8ed8e36da7929cf74074f6ef6f79d8
parent7ab26a8d05c497a84c02c224b06aa2845198acf9 (diff)
woman: Rewrite script in sh
-rwxr-xr-x.local/bin/woman25
1 files changed, 13 insertions, 12 deletions
diff --git a/.local/bin/woman b/.local/bin/woman
index c68728d..9acf7fd 100755
--- a/.local/bin/woman
+++ b/.local/bin/woman
@@ -1,16 +1,17 @@
-#!/usr/local/bin/andy
+#!/bin/sh
# TODO: -s flag to apropos
-apropos .
-| sed -E 's/ (\([^)]+\))\s*-/\1 —/'
-| sort
-| osel
-| sed 's/\s.*//'
-| read page
+page="$(apropos . \
+ | sed -E 's/ (\([^)]+\))\s*-/\1 —/' \
+ | sort \
+ | osel \
+ | sed 's/\s.*//')"
-if test -n $page -a ! -t 2 {
- man -Tpdf $page | zathura -
-} else if test -n $page -a -t 2 {
- man $page
-}
+if [ -n "$page" -a ! -t 2 ]
+then
+ man -Tpdf "$page" | zathura -
+elif [ -n "$page" -a -t 2 ]
+then
+ man "$page"
+fi