I have a file with several thousand lines. I'm looking to replace newline character with ' || ' (that is ||)
I'm wanting to this via bash on Ubuntu 20.04
I've tried the following but in vain -
tr '\n' ' || ' < input.txt
tr '\n' ' \|| ' < input.txt
tr '\n' ' \|\| ' < input.txt
I'm not able to work out what I'm doing wrong. Please can someone help me spot my mistake?