Borderline ServerFault question, but I\'m programming some shell scripts, so I\'m trying here first :)
Most *nixes have a command that will let you pipe/red
@rhileighalmgren solution is good, but pbcopy will annoyingly copy last "\n" character, I use "head" to strip out last character to prevent this:
#!/bin/bash head -c -1 | ssh desktop pbcopy
My full solution is here : http://taylor.woodstitch.com/linux/copy-local-clipboard-remote-ssh-server/