savetheWorld 1189600180 learn to enter a newline on the command line for sed : echo "hello my friends" | sed $'s| my |\\\n|' << the $ in front of the singlequotes makes bash expand the \n to a newline... the \\ expands to a literal \, that escapes the newline for sed greycat 1234366564 forget greycat 1234366608 learn The unix end of line marker, ASCII value 10, often written \n.