kyle k
kyle k

Reputation: 5522

Compile contents of clipboard

How can i compile the contents of the clipboard, i tried piping the contents pbpaste | gcc but it did not work it gave the error i686-apple-darwin11-llvm-gcc-4.2: no input files I have heard that i can use temporary file with the command mktemp but I could not get it to work.

Upvotes: 0

Views: 175

Answers (1)

Shafik Yaghmour
Shafik Yaghmour

Reputation: 158629

Using -xc - will allow you to process stdin:

gcc -xc -

You can see a live example here.

Upvotes: 2

Related Questions