I'm pulling some data from a database and one of the strings I'm getting back is in one line and contains multiple instances of the string
\n\nCreate a URL where the client can point their web browser to. This URL should test the following IP addresses and ports for connectivity.
echo "$someString" | tr '\\n' ''
tr utility will only work with single characters, transliterating them from one set of characters to another. This is not the tool you want.
newvar="$( sed 's/\\n//g' <<<"$var" )"
The only thing worth noting here is the escaping of the
\n. I'm using a here-string (
<<<"...") to feed the value of the variable
var into the standard input of