By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,809 Members | 1,999 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,809 IT Pros & Developers. It's quick & easy.

how to capture console output by using perl?

P: 1
How do I capture console output by using perl?

We are running some commands in console. My intention is to capture and save that output by using a Perl script.
May 17 '10 #1
Share this Question
Share on Google+
2 Replies


numberwhun
Expert Mod 2.5K+
P: 3,503
I am not 100% on what you are asking about, but maybe this will help you.

Regards,

Jeff
May 17 '10 #2

Expert 100+
P: 785
On Unix, all commands are already captured in the history file.
Or do you want to program a keyboard hook in perl in Windows? That would be a difficult task. But you can easily write a perl program that emulates a shell:

The user starts the perl program and then types his shell commands inside, which are then standard input for perl. The perl program then both executes (system $command, see link from numberwhun) the commands and saves them in a file.
May 19 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.