X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:date:from:to:subject:message-id:references
	:mime-version:content-type:in-reply-to; q=dns; s=default; b=Yyke
	3UP121usTqztBNBYPX4GMP312ZqTqO0RxL+TDLs1tTFI2Mc5nbKt6W+x7yPfzZne
	K7Z5SVY+sNpqGtg1Ig2VrY/7+RMrdifhgDrUPheWb7VAa0V0DViyqvH/VVL5VCIi
	Fe5m+o7IJwYcUXDDGUJHuJ0U7VFX0/QiremQDBs=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:date:from:to:subject:message-id:references
	:mime-version:content-type:in-reply-to; s=default; bh=2zoM42TnyZ
	iFiChFaqLRlJhgKWc=; b=L+RCVvd4Y32RFzr7sr/b5awsOpOdQlV7USMtuNnHf9
	4JaG0semcy6tjK6gj1DY/S/2Mk5DRMZXOYdg7Z/pI7c3KeAoUWvmn05rh7B8lDjB
	C0fVDMiFCJ2OhXeWQxtESYqhDSw4oT9IR8MpvPcJGYZ4UcrK4AIWCw2oUvrEt+NT
	E=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2
X-HELO: mail.spocom.com
Date: Wed, 1 Oct 2014 16:06:38 -0700
From: Gary Johnson <garyjohn@spocom.com>
To: cygwin@cygwin.com
Subject: Re: Direct/efficient way to chop off trailing \n
Message-ID: <20141001230637.GD10508@phoenix>
Mail-Followup-To: cygwin@cygwin.com
References: <loom.20141001T235147-60@post.gmane.org> <542C854D.3050001@jhmg.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <542C854D.3050001@jhmg.net>
User-Agent: Mutt/1.5.20 (2009-06-14)
X-IsSubscribed: yes

On 2014-10-01, Jim Garrison wrote:
> On 10/1/2014 2:52 PM, Paul.Domaskis wrote:
> > Running bash in a Windows environment, I often find the need to
> > generate a full Windows path to a file so that I can access the file
> > from a Windows app.
> [snip]
> >... but it does remove the trailing \n which chokes up
> > Windows.
> 
> Sounds like cygpath needs a "-n" option which eliminates the
> trailing newline.

The trouble with that is that the "problem" is common to (almost?)
all Unix commands, not just cygpath.  That is, they all send their
output to stdout as lines of text, each line terminated by a
newline, as it should be.  You can send the output of any command to
/dev/clipboard and it will be terminated by a newline.  If that's
not desired, then one needs to take extra steps in the pipeline,
which is what tr is for.

Another solution would be to wrap the redirection to /dev/clipboard
in a function or script that takes your "-n" option and pipe the
output of cygpath or whatever command to that wrapper.

Regards,
Gary


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

