I got a line of code in bash that is supposed to output this:
identity="A273927A49D0"
(The content of identity
is stored in $usercaps
)
My line of code is:
echo "identity=\"$usercaps\"" >> ttls.conf
However if I do that, the output becomes: identity="A273927A49D0^M"
I can get around it by adding this:
echo "identity=\"$usercaps\"" | sed 's/\r//' >> ttls.conf
Why is this happening and is this the only way to deal with it?