I'm writing a small Perl script that reads in some files and does some calculations and spits the text to STDOUT. All I ever do with this text is copy it to my clipboard and paste it in an Excel spreadsheet. But I wondered...is there some way I can copy the text to my clipboard without having to select exactly what I want and hitting Ctrl-Shift-C? The answer is surprisingly easy!
The following was done on Ubuntu:
$ sudo apt-get install xsel
$ echo -n "Put me in the clipboard." | xsel -ib
$
[hit Shift-Insert]
$ Put me in the clipboard.
Voila! The -i switch tells xsel to work in input mode (as opposed to append or follow mode) and the -b switch tells it to work with the clipboard. Check out the man page for more cool stuff you can do with it.
No comments:
Post a Comment