#!/bin/sh -e # differences between man-db and mandoc apropos(1) make it more # difficult to parse # thanks go to opal length="$(apropos . \ | sed -r -e's/ ?\(/(/' \ | sed 's/^/man:/g' \ | cut '-d ' -f1 \ | tr -c ' \n' '_' \ | sort \ | tail -n1 \ | wc -c)" apropos . \ | sed -r -e's/ ?\(/(/' \ | sed 's/^/man:/g' \ | tr -s ' ' \ | sed 's/ /\t/' \ | spacify "${length}"