Can tr replace one character with two characters?
I am trying to replace \"~\" with \"~\\n\" but the output does not produce the newline.
$ echo \"a
you could go with awk, let FS/OFS variable do the job for you:
awk -F'~' -v OFS="~\n" '$1=$1'
test with your example:
kent$ awk -F'~' -v OFS="~\n" '$1=$1' <<< "asdlksad ~ adlkajsd ~ 12345" asdlksad ~ adlkajsd ~ 12345