News for hackers. Stuff that matters.
Re:CR+LF Has a Long History by ghshephard on Tuesday February 08, 2022 @04:01AM (#30256272)
Weird - I also had to write this exact thing:

   Creds ()
   {
       kubectl exec -ti $(getpod cred-api) -- printenv | grep --color=auto --color=auto RAWDATA | tr -d '\r'
   }
Re:CR+LF Has a Long History by j1elo on Tuesday February 08, 2022 @04:42AM (#30256532)
See my "UPDATE" comment; basically the issue seems to be that the output from "docker run" will contain DOS-type line breaks ("\r\n") if running with a pseudo-tty attached, so, with the "-t" argument. If that is not needed (e.g. when scripting) this argument can be dropped, and then the stdout comes clean with Linux style line breaks ("\n").

I don't know about kubectl, but if those "-ti" mean the same as in plain Docker, you could check if dropping the "-t" helps. After all, it looks like you are also scripting, so any kind of interactive input/output would probably be unexpected and undesired in your command.