You're a little ambiguous. I expect you're probably a Linux user inside X who wants to put stuff in the X PRIMARY
clipboard.
It's important to understand that bash
doesn't have a clipboard. There is no such thing as "the" clipboard, because bash
can run on Windows, Mac OS X, lots of other OSes, inside X, outside X, ... Not to mention that X itself has three different clipboards itself. There's a wealth of clipboards you could be dealing with. Usually the clipboard you want to talk to has a utility that lets you talk to it.
In case of X, yes, there's xclip
(and others).
If you're trying to talk to the Mac OS X clipboard, there's pbcopy
.
If you're in Linux terminal mode (no X) then maybe you need to look into gpm
.
There's also GNU screen
which has a clipboard. To put stuff in there, look at the screen
command "readreg
".
For Windows, I expect cygwin
will have a tool.