CMD Prompt: Copying to Clipboard Adds Trailing Space
Posted: 2022-Jan-23, 12:36 pm
I've noticed that, at the cmd prompt, when piping to the clipboard a trailing space is added to each line.
Compare the following two commands typed at the cmd prompt:
Does anyone know why this happens? Better yet, does anyone know how output from stdin can be piped to the clipboard without trailing spaces?
Compare the following two commands typed at the cmd prompt:
Code: Select all
(for %a in (red green blue) do @(echo %a)) > tmp & notepad tmp
Code: Select all
(for %a in (red green blue) do @(echo %a)) | clip
Does anyone know why this happens? Better yet, does anyone know how output from stdin can be piped to the clipboard without trailing spaces?