15 ms·
> Still I find it very odd that cat didn't show anything, perhaps it is because the carriage return, brings the cursor back to the beginning of the line, effect
by jolmg 3y ago
> Still I find it very odd that cat didn't show anything, perhaps it is because the carriage return, brings the cursor back to the beginning of the line, effectively erasing the line that was just output.
Bringing the cursor back doesn't delete what was output. It's writing over it with the second line and the shell prompt that deletes it.
If you set `PS1='$ '`, one should be able to see part of both lines:
$ printf '"order_id","date"\r"1","2023-01-01"\r'
$ ","2023-01-01""