开发者

How to collect the output of man command in tcl?

Can somebody suggest me, how to collect output of man command in tcl?

I am writing :-

set hello [ man {command-name}]

and when am executing the script, the program gets halted and man commands start running in the foreground, prompting the user to "press RETURN" again and again till it gets 开发者_StackOverflow中文版completed.


You're just missing the exec command

set output [exec man cmd-name]

When you do set out [man cmd-name] in an interactive tcl session, the unknown command will intercept the 'man' command and implicitly perform an exec on it. In that scenario, 'man' somehow knows you're interactive and pipes the manpage through your $PAGER.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜