What is the simplest way to parse line continuation characters? This seems like such a basic action that I'm surprised there's no basic command for doing this. 'while read' and 'while read -r' loops don't do what I want, and the easiest solution I've found is the sed solution below. Is there a way to do this with something basic like tr?
$ cat input Output should be \ one line with a '\' character. $ while read l; do echo $l; done < input Output should be one line with a '' character. $ while read -r l; do echo $l; done < input Output should be \ one line with a '\' character. $ sed '/\\$/{N; s/\\\n//;}' input Output should be one line with a '\' character. $ perl -0777 -pe 's/\\\n//s' input Output should be one line with a '\' character.