Thursday, August 10, 2006

How to redirect output to "clipboard" on command line: "

#:912674 12:42 am on Dec. 26, 2004 (utc 0)

For those not using Cygwin, there is an X-Windows utility called 'xclip' which reads STDIN and puts the input into an X clipboard.

cat filename ¦ xclip

X clipboards are not the same as Gnome or KDE clipboards, however. Someone wrote a bash function for KDE called 'klip' that uses the KDE utility 'klipper' to do the same thing (search for it).. I didn't find anything similar for Gnome, but some Gnome apps play nicely with X clipboards...so maybe xclip would work?

So it will depend on which application are you pasting into, unfortunately. "

No comments: