News for hackers. Stuff that matters.
Re:The Art of Command Line (2015) by vram22 on Thursday May 23, 2019 @06:13AM (#19990260)
Or, if you're fine with reading it online, but don't want to run the man bash command each time (for whatever reason), and/or want to strip out the formatting characters once and for all, and/or want to use the search and other editing features of your favorite text editor on the contents of the man page, for faster navigation, copying-and-pasting snippets into scripts, etc., you can use this small shell script:

m, a Unix shell utility to save cleaned-up man pages as text:

https://jugad2.blogspot.com/2017/03/m-unix-shell-utility-to-...

Edit: Also check out the stuff about the word mu in the latter part of the post :)

Re:The Art of Command Line (2015) by u801e on Thursday May 23, 2019 @08:53AM (#19991216)
In vim, I can run:

  :r !man bash | col -b
the col utility will strip backspace characters with the -b switch (along with reverse line feeds).
Re:The Art of Command Line (2015) by uolot on Friday May 24, 2019 @08:15AM (#20000671)
You can also display man pages in vim by default:

    export MANPAGER="/bin/sh -c \"col -b | vim -c 'set ft=man ts=8 nomod nolist nonu noma' -\""
Re:The Art of Command Line (2015) by vram22 on Thursday May 23, 2019 @11:03AM (#19992392)
Right. But check what my script called m does :)

It uses col, but also redirects the cleaned-up output to a file named cmd.m (so you don't have to run that man command for the same command - like bash or other - each time), where cmd is the cmd you give to man as an arg. That file cmd.m is stored under your ~/man dir, which gets created first, with mkdir -p. More refinements possible, of course, but this was just a quick and dirty script I whipped up. For example, could check more for permission and other kinds of errors, not create the ~/man dir each time but only once, etc.