News for hackers. Stuff that matters.
Re:OS X Command Line Utilities by imahorse on Sunday August 30, 2015 @04:03PM (#10144328)
Wow, that's really useful. For everyone who is as bad as me in bash, to actually use it put it like this in your bashrc:

function clip() { [ -t 0 ] && pbpaste || pbcopy }

Re:OS X Command Line Utilities by JonahBraun on Sunday August 30, 2015 @07:32PM (#10144771)
I think you posted this because pasting the OP results in a syntax error. The problem is actually the list in the compound command needs to be terminated with a newline or semicolon. Both of the following are equivalent correct oneliners:

clip() { [ -t 0 ] && pbpaste || pbcopy;}

function clip { [ -t 0 ] && pbpaste || pbcopy;}