Domanda

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 completed.

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top