I have:
alias pbcopy='xclip -selection clipboard -in'
This allows me to do things like date | pbcopy
, to get the date in the clipboard.
However, I also get a newline character at the end of the date which needs to be manually removed after pasting.
How can I remove the final newline (and only the final newline) from a pipeline?