News for hackers. Stuff that matters.
Re:List of hidden OS X features, tips and tricks by mh- on Monday June 24, 2013 @01:56AM (#5931262)
when you pipe something to pbcopy, it doesn't strip any trailing newline:

    echo hi | pbcopy
pasting this would get you hi<cr>. so if you want to put the output of a command in the clipboard, you can do something like (where `find .` is your command):

    echo -n $(find .) | pbcopy
that will take advantage of the fact that subshells discard a trailing newline (at least in bash, zsh. probably others..)

There are no comments on this comment yet.