views:

99

answers:

3

Hello,

I find myself running scripts and copy-pasting the output of these runs into emails or into some other documents. Is there a way such that I can make the copy-to-clipboard step a part of the script itself? Most of my scripts are either perl or bat files and I work on windows.

Thanks,

Rohit

A: 

Not sure about the clipboard but you can pipe the output to a text file but doing something like this:

somescript.bat > output.txt
digitalsanctum
A: 

In Perl, install and use Win32::Clipboard module

Krzysztof Kowalczyk
+2  A: 

There's a utility called clip.exe that you can use. Just pipe the output of your script or any other command into clip.exe (First, put it on your path somewhere. If you don't have a usual place for these kindss of utilities, you can dump it in the directory you usually run your scripts from, or I've known people to use c:\Windows\system32 in a pinch...):

somescript.bat | clip

Then paste away.

Blair Conrad