$ cat in foo bar Ubar Ubaz quux $ perl -p0e 's/\nU/U/g' in foo barUbarUbaz quux $