in reply to print real newlines in place of literal ones
The problem is that \n is not a variable, you can't interpolate it, it is a meta character that the print, etc. understand. When you read in your key/value pair of TEXT=Hello\nWorld\n! you are reading in a literal "\" and a literal "n", not the metacharacter "\n". Once it is read in as "\" and "n", no amount of interpolation will make it a meta character. For all intents and purposes, you can look at your input text as: "Hello\\nWorld\\n!".
You were on the right track with your substition.
HTH
|
|---|