I am looking to pass a list of variables from a text file into a simple bash command. Essentially I have a list of all linux commands (commands.txt). I want to pass each command from that file (each is on a new line) to the man command and print each to a new .txt file so each variable would be passed to this:
man $command > $command.txt
so each variable would have its man page printed to its name .txt. Please help! I would like to do this in bash script but anything that will work would be appreciated.
manblindly like this, since depending on your pager your might have surprises. On my system, my pager isvim, and your command would hang my terminal. At least, useman -P cat $commandto use a more trivial pager (herecat). It will also make things slightly more efficient.