Hacker News new | ask | show | jobs
by vram22 4373 days ago
Speaking of man pages, in earlier versions of Unix and Linux, I used to want to redirect the output of many man commands to files for later reading, e.g. if working on C, say I wanted to read 'man ioctl', 'man stdio', 'man signal', etc. But the man output had {n|t}roff formatting characters in it, for print output, which used to mess up vi. So I used to use this script I wrote, called m:

# Put this script in a directory in your PATH.

# m: pipe man output through col and save to file(s).

mkdir -p ~/man # Only creates the dir first time, including all dirs in the path.

for name: # in $* is implied

    man $name | col -bx > ~/man/$name.m
done

Do a "chmod u+x m" to be able to run it.

Then run it like this:

m ioctl stdio signal # or any other commands

Then:

pushd ~/man; view ioctl.m stdio.m signal.m; popd

to read those pages, now stripped of formatting characters.