[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cygwin-patches
Subject:    Re: New modes for cygpath that terminate path with null byte, nothing
From:       Christopher Faylor <cgf-use-the-mailinglist-please () cygwin ! com>
Date:       2012-07-27 15:00:00
Message-ID: 20120727150000.GA10003 () ednor ! casa ! cgf ! cx
[Download RAW message or body]

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
>newline.

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

cgf
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic