And I have one that unifies _both_ to `clip` so you can put the same command in both sides of the pipe, e. g. to turn a line-delimited blob on your clipboard to a space-separated one:
clip | tr '\n' ' ' | clip
https://github.com/svieira/dotfiles/blob/a3654d6a194e3689978... # Use clipboard in shell pipelines
# clip | xargs echo # uses pbpaste
# ps -A | grep search | clip # uses pbcopy
clip() {
[ -t 0 ] && pbpaste || pbcopy
}