Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The pbpaste command deletes newlines in the clipboard contents before writing to the target file

I'm writing the contents of the clipboard to a txt using pbpaste, for some reason it deletes all newlines from the text in the clipboard.

This is the command I'm using:

echo `pbpaste` > /Users/me/file.txt

It works as expected except for the fact that none of the newlines from the clipboard contents are to be found in the target file.


1 Answers

Is there anyway to keep the newlines?

Yes, by eliminating echo:

pbpaste > /Users/me/file.txt
like image 162
devnull Avatar answered Oct 25 '25 01:10

devnull



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!