cmacosgccclipboard

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.


Solution

  • Using -xc - will allow you to process stdin:

    gcc -xc -
    

    You can see a live example here.