Last active
May 13, 2022 23:46
-
-
Save kristopherjohnson/2983879 to your computer and use it in GitHub Desktop.
Display man page as HTML
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Displays man page as HTML page | |
# | |
# Requires the man2html utility, which can be installed on OS X with Homebrew (brew install man2html) | |
# See http://dcssrv1.oit.uci.edu/indiv/ehood/man2html.html for more info. | |
if [ -z "$1" ]; then | |
echo "usage: hman MANPAGE" | |
exit 1 | |
fi | |
mkdir -p "$TMPDIR/hman" | |
tmp_file="$TMPDIR/hman/$1.html" | |
man $1 | man2html > "$tmp_file" | |
open "$tmp_file" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment