On Sat, Dec 10, 2022 at 10:07:48PM -0500, Jim Popovitch wrote: > On Sat, 2022-12-10 at 20:35 -0600, David Wright wrote: > > On Sat 10 Dec 2022 at 21:01:29 (-0500), Jim Popovitch wrote: > > > Why does this produce a CR/LF > > > > > > ~$ TEST=$(ssh -o LogLevel=QUIET -t user@server "echo -n ''"); echo > > > ${TEST} > > > > Try echo -n ${TEST} at the end. > > Thanks, that works if the remote cmd produces no output, but if the > remote cmd produces output than the -n strips the intentional CR/LF.
WOW, THAT WAS FAST! We have now reached the point where the question has changed, so that the newline-stripping behavior of the $() command substitution is relevant. There is still no CR. At all. Ever. This is not Microsoft Windows. So... what are you actually trying to do?