New modes for cygpath that terminate path with null byte, nothing

Christopher Faylor
Fri Jul 27 15:00:00 GMT 2012

On Fri, Jul 27, 2012 at 01:08:02AM -0700, Daniel Colascione wrote:
>I wrote this patch because I often write this:
>$ cygpath -aw foo > /dev/clipboard
>Today, cygpath always appends a newline to the information in the
>clipboard, which is annoying when trying to paste into a program that
>interprets newlines specially. This patch implements two new options:
>-0/--null and -n/--no-newline. The former separates all paths output by
>cygpath with a null byte; the latter separates them with nothing at all.
>With -n, my example above works more smoothly and pastes don't include a

You could trivially accomplish these tasks with the use of 'tr':

cygpath -aw foo | tr -d '\n' > /dev/clipboard
cygpath -aw foo | tr '\n' '\0' >/dev/clipboard


More information about the Cygwin-patches mailing list