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.
Asked
Active
Viewed 155 times
0

kyle k
- 5,134
- 10
- 31
- 45
-
1`gcc -xc -` should allow you do to that I think. – Shafik Yaghmour Aug 25 '13 at 02:39
1 Answers
2

Shafik Yaghmour
- 154,301
- 39
- 440
- 740
-
I got this warning **i686-apple-darwin11-llvm-gcc-4.2: warning: '-x c-' after last input file has no effect** **i686-apple-darwin11-llvm-gcc-4.2: no input files** – kyle k Aug 25 '13 at 02:46
-
1
-
It won't compile anything it just freezes, my clipboard only contains a hello world program. – kyle k Aug 25 '13 at 02:56
-
1@kylek this works fine in the live example I linked and in my linux VM, so there may be something weird about the format of the data coming from the clipboard, is it in plain text? Maybe you can [redirect to a file](http://stackoverflow.com/questions/6674327/redirect-all-output-to-file) and see if that will compile and if not determine what about the format is causing the problem. – Shafik Yaghmour Aug 25 '13 at 03:03