5 ms·
Note that this doesn't work on macOS, where the builtin `man` command doesn't support the `-l` option.
by sicromoft 6y ago
Note that this doesn't work on macOS, where the builtin `man` command doesn't support the `-l` option.
- ahnick 6y agoAh interesting, is there any workaround for Mac? Otherwise, I may just have to fallback to stripping the man page formatting and sending it to less.
- enriquto 6y ago> is there any workaround for Mac? Yeah, any regular unix will do, for example openbsd, freebsd or any linux distribution.
- tobylane 6y agoIf I understand your need correctly: pandoc.
- ahnick 6y agopandoc is not installed on macOS out-of-the-box though right? The user would have to pull via homebrew or something?
- gpanders 6y agoThe actual `man` command does this: /usr/bin/tbl | /usr/bin/groff -Wall -mtty-char -Tascii -mandoc -c | /usr/bin/less -is So you could do it "manually" that way. Not the cleanest or prettiest solution but it's much lighter weight than using something like pandoc. EDIT: Full example: { /usr/bin/tbl | /usr/bin/groff -Wall -mtty-char -Tascii -mandoc -c | /usr/bin/less -is; } <<EOF .\" Manpage for encpass.sh. .\" Email contact@plyint.com to correct errors or typos. .TH man 8 "06 March 2020" "1.0" "encpass.sh man page" .SH NAME encpass.sh \- Use encrypted passwords in shell scripts ... EOF
- ahnick 6y agoThanks, this worked well on Mac.