1 2 3 4 5 6 7 8 9 10 11 12
#!/bin/sh apropos . \ | sed -E 's/ (\([^)]+\))\s*-/\1 —/' \ | sort \ | osel \ | sed 's/\s.*//' \ | { IFS= read -r page [ -n "$page" -a ! -t 2 ] && man -Tpdf "$page" | zathura - [ -n "$page" -a -t 2 ] && man "$page" }