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:reply-to:message-id:to:subject
	:in-reply-to:references:mime-version:content-type
	:content-transfer-encoding; q=dns; s=default; b=FUF7U2op6Ll7J73M
	rQ7qT4X0jIVOO7a6ZQ47XEa1fwRtuOOtOjxrsp3rQp9+f+MsFBu5huzjSeTiFwtQ
	URKebeI2/Eypo9wHbygP0dlIUBoB8Q8u6S/HCC4GsnUzSZXyZKlVkaeAC7z9KukO
	xt+At4/FjUp3BZ7Tcid6b40tb0U=
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:reply-to:message-id:to:subject
	:in-reply-to:references:mime-version:content-type
	:content-transfer-encoding; s=default; bh=5HBwbiOO9q0sxDI3rpSh+F
	lEfO8=; b=xAqjEZ8yY/cpj62EtpxgIjmlwXPd1F+Yx2Rn4IkCV30TUKiwD6llie
	9VBHxM06WUtbRFObDRxbWWS6XRj/ry1U6J1iS4JMVENNMIZUJw4qDEPTnGs0rsKR
	jNuy9wEaZzwuL3IYua0yLA0GxIDkjx6hW9LYOyDbWXetTlNZLMF5k=
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: Yes, score=5.9 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,HELO_LH_HOME,KAM_THEBAT,RDNS_NONE autolearn=no version=3.3.2
X-HELO: smtp.ht-systems.ru
Date: Mon, 30 Sep 2013 22:26:14 +0400
From: Andrey Repin <anrdaemon@yandex.ru>
Reply-To: Andrey Repin <cygwin@cygwin.com>
Message-ID: <1255057745.20130930222614@mtu-net.ru>
To: Paul <Paul.Domaskis@gmail.com>, cygwin@cygwin.com
Subject: Re: Unexpected results: dirs | xargs -n 1 cygpath -aw
In-Reply-To: <loom.20130930T180840-645@post.gmane.org>
References: <loom.20130930T180640-573@post.gmane.org> <loom.20130930T180840-645@post.gmane.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes

Greetings, Paul!

> Sorry, this is a re-post.  I did not completely sanitize the last post, 
> leading to inconsistent info.  Unfortunately, I can't edit or retract a 
> post from a mailing list.  Here is the self-consistent post:

> I'm doing something wrong with xargs.  If I simply use "cygpath -aw" with 2 
> arguments, it works fine:

>    $cygpath -aw ~/projects/project1 ~/projects/project2

>       C:\cygwin\home\UserName\projects\project1
>       C:\cygwin\home\UserName\projects\project2

> If I use "xargs -n 1" with echo, it works fine:

>    $dirs | xargs echo

>       ~/projects/project1 ~/projects/project2

>    $dirs | xargs -n 1 echo

>       ~/projects/project1
>       ~/projects/project2

> However, if I use xargs with cygpath, it doesn't:

>    $dirs | xargs -n 1 cygpath -aw

>       C:\cygwin\home\UserName\projects\project1\~\projects\project1
>       C:\cygwin\home\UserName\projects\project1\~\projects\project2

> Thanks if anyone can explain what I'm doing wrong.

First of all, your problem is that you're using "dirs". Tilde expansion is
done by shell before command is executed, it is not done by xargs, or cygpath.
Replacing "dirs" with "ls" in your command gave me the desired results.

AnrDaemon@daemon2 ~/cr3
$ ls | xargs -n 1 cygpath -aw
C:\home\Daemon\cr3\bookmarks
C:\home\Daemon\cr3\cache
C:\home\Daemon\cr3\cr3hist.bmk


--
WBR,
Andrey Repin (anrdaemon@yandex.ru) 30.09.2013, <22:20>

Sorry for my terrible english...


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

