Copy text from command line as formatted text So I have a script that outputs this

&lt;pre style="background:#f1f1f1;color:#000;font-weight:bold;"&gt;echo 'Hello World';&lt;/pre&gt;


What I would like to do it copy it to the clipboard as rich text and not plain text.  Is this possible?

Right now I have this command:

create-codeblock | pbcopy


This obviously only copies the plain text html code to the clipboard.  What I really want is the html formatted version copied to the clipboard.  Any thoughts?

What I am trying to do in the end is paste rich formatted text into Evernote.
As aglasser commented, you can use textutil like so:

create-codeblock | textutil -stdin -format html -convert rtf -stdout | pbcopy