views:

147

answers:

2

I've found myself needing to do this a couple of times lately and wondered if there was a way to do this in the OS already. Failing that, I've got a pretty good idea of how to write a script to do it, I just need to know how to access the clipboard in os x.

+4  A: 

Nevermind, figured it out.

 pbcopy < filename

  #copies contents of a text, rtf, or eps file to the clipboard


  pbpaste

  #pastes content of clipboard to stdout
Paul Wicks
That's awesome. Where did you find this info, and are there other cool conduits between CLI world and GUI world?
slim
+2  A: 

Yep, that's the way to go. Of course, you can also pipe output into it, ie, echo "test" | pbcopy.

William Keller