Hey I have to create a unix script that when run uses the 'man' command to print out the command information of commands passed as arguments. I have the basic pseudo code, but I don't know how to implement a loop. Any help is greatly appreciated. Cheers.
short-manual <ls cc pwd>
for(i=1;i<max_argument;i++)
do
man argument
echo -------------
i=i+1
end loop
Can someone direct me to a syntax for this please.
I don't know for sure what the goal of this is, but if you want to simply display all of the page, as opposed to simply opening it in a less-type interface, you might do:
man "$i" | col
For that matter, "col" is a convenient way to save the pages to another file, or to pipe to a mail command, etc.