Basically I want to achieve something like the inverse of echo -e
. I have a variable which stores a command output but I want to print newlines as \n.
Here's my solution:
sed 's/$/\\n/' | tr -d '\n'
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments