Loading clipboard programmatically

Murray Colpman muzerakascooby at gmail.com
Wed Jun 17 19:56:58 UTC 2009


2009/6/17 Brian McKee <brian.mckee at gmail.com>
>
> On Tue, Jun 16, 2009 at 10:32 PM, Ray Parrish<crp at cmc.net> wrote:
> > Does anyone know if there is a way to write a script with bash or perl
> > which will load a value into the clipboard from a text file?
>
> I think the first question is - which clipboard?
>
> Take a look at 'xclip' -
> xclip is a command line utility that is designed to run on any system
> with an X11 implementation. It provides an interface to X selections
> ("the clipboard") from the command line. It can read
>  data from standard in or a file and place it in an X selection for
> pasting into other X applications. xclip can also print an X selection
> to standard out, which can then be redirected to a file
>  or another program.
>
>  Homepage: http://people.debian.org/~kims/xclip/
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users

In a modern environment, xclip should be called like this to do what
you're after:

cat filename.txt | xclip -selection clipboard




More information about the ubuntu-users mailing list