开发者

Capture all input and output from a bash script

I am trying to capture all the input and output from a bash script that i created for installing nagios. I have it creating the log file using tee right now but it only shows when there开发者_开发知识库 is an echo command or some output from like "service httpd restart". I mainly want to capture the input the user is entering in the log file for future reference.


The script command, run prior to your program, will capture all input and output to a file you specify. It terminates with a ctrl-D.

script -c yourprogram filename

may do what you're looking for. See the man page for script.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜