bash replace newline with space code example
Example 1: bash replace newline with space
Just use tr command as follow:
tr '\n' ' ' < file #Replaces all newlines matches with a space ' '
Example 2: tr new line
Just use tr command as follow:
tr , '\n' < file #Replaces all ',' matches for a new line