Reputation: 297
I'm on OS X server try to copy a formatted text from vim and then would like to save it to another file via bash. I want my new file looks like the text that was copied into vim to clipboard - with line breaks, space indentations... instead I get a plain text in one line.
I do this, after copping: echo `pbpaste` > file.txt
Is there a way to save formatted text to the new file?
Upvotes: 1
Views: 323
Reputation: 96266
No need to echo.
pbpaste > file.txt
The problem was caused by the lack of quotation:
echo `echo "x x"` #x x
echo "`echo "x x"`" #x x
Upvotes: 3