Easiest way to strip newline character from input string in pasteboard
I wrote a utility called noeol
to solve this problem. It pipes stdin to stdout, but leaves out the trailing newline if there is one. E.g.
pwd | noeol | pbcopy
…I aliased copy
to noeol | pbcopy
.
Check it out here: https://github.com/Sidnicious/noeol