> function clip { [ -t 0 ] && pbpaste || pbcopy }
That's great! Would you please explain why that works? Are there any cases you know of where that doesn't work as expected?
Edit: btw you need a semicolon after pbcopy to make that function valid on one line.