2 ms·
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 ou
by mh- 13y ago
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..)