Curl from Pastebin messes with carriage returns
For reasons that pass understanding pastebin.com raw mode uses Windows line endings - carriage return followed by linefeed - rather than plain linefeed that is used by all right thinking operating systems.

So you need to remove the carriage returns. The easiest way to do this is using tr.

curl https://pastebin.com/raw/qg0r3wt | tr -d '\r' &gt; .profile


That will save the contents of the pastebin qg0r3wt into the file .profile with carriage returns removed.