Putting it in a file as suggested will work. But in looking online, it seems to me that Ctrl-D should signal end-of-file on OSX. I don't know why it's not working. I've never used a Mac, though. Can anyone who does use OSX share their experience?
It might be Cmd+D (command, the stupid apple thing that basically replaces ctrl).