You can use the xclip utility to manipulate the X clipboard from the commandline or from a script. This command will overwrite the current X clipboard selection with the contents of /etc/passwd so a subsequent paste will contain the text of the file:
$ xclip < /etc/passwd
Download source from http://people.debian.org/~kims/xclip/.
clipboardcopypastex11xclip