How to collect man command output in tcl?

Can someone suggest me how to assemble the output of the man command in tcl?

I write: -

set hello [ man {command-name}]

and when the script is executed, the program stops and the man commands start working in the foreground, causing the user to "press RETURN" again and again until it is completed.

+3
source share
1 answer

You just miss the exec command

set output [exec man cmd-name]

When you execute set out [man cmd-name]in an interactive tcl session, the command unknownintercepts the "man" command and implicitly executes exec on it. In this scenario, the person somehow knows that you are interactive and presses manpage through your $ PAGER.

+4
source

All Articles