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=vcdL2LUOssRUXW2V
	Vf/7RDrhsOKiN9jNQom+a/bcJJmI3y8nju3cKE6xRrgQXcOhVKaHBmnGcluy5UiE
	/tLPWQJxCSzoDxq/ADoD/4IdRo7yfVXjdAz9hG4BIEn4n2S4Nrbi71ZUujz6ptcM
	ujaSh1Xe0ZqQHg6m6ttypdWlclI=
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=zxYFr64ohaHtDThQxoA8SR
	/LDEE=; b=E8VxGuwvi1K2N5mtrDyUbvzyCIJYwp7eoEp+r21Ffdj7UCMSNH9oO8
	RamN1JhU9otFkavBZ3tlYTKycoJ9HrWey9FTWqypRR1uJ9tATvznMKWR2dho47rO
	OvwUrGRkaKrJg1ipXJ80O7eIKy4e/ytB+c7TB2TlB6dm0iDwNhC5A=
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=4.8 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,HELO_LH_HOME,KAM_THEBAT,KHOP_THREADED,RDNS_NONE autolearn=no version=3.3.2
X-HELO: smtp.ht-systems.ru
Date: Tue, 17 Sep 2013 17:00:10 +0400
From: Andrey Repin <anrdaemon@yandex.ru>
Reply-To: Andrey Repin <cygwin@cygwin.com>
Message-ID: <337763713.20130917170010@mtu-net.ru>
To: Robert Klemme <shortcutter@googlemail.com>, cygwin@cygwin.com
Subject: Re: cygpath -m behaviour change
In-Reply-To: <CAM9pMnPLLjZs3RAzg1tOgREH45-vP22tTT_3Pzob86POBXh=UQ@mail.gmail.com>
References: <CAF+hkWo0jXKKLM8pS8gZLG0rak+wcLpWJdS2He2_=MxYb0gpYw@mail.gmail.com> <CAM9pMnPLLjZs3RAzg1tOgREH45-vP22tTT_3Pzob86POBXh=UQ@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes

Greetings, Robert Klemme!

>>> Yes, that's exactly right, assuming that 'boo' doesn't exist.
>>
>> Hi, it happens even if boo does exist. To put it in context, the
>> script in question was attempting to determine the current directory:
>>
>> CURRENT_DIR=$(cygpath -ma "${0}"/../)

> I am confused: do they need the current directory or the directory
> where the script resides?  The use of -m also sounds a bit weird to
> me.  I'd rather use -u or -w depending on who is supposed to use the
> value (i.e. a Windows process or a Unix Cygwin process).

I often prefer -m in case I need to pass this path to other, non-cygwin tools.
Though, there's less and less of these cases, thanks to continued effort of
community to provide a wide range of packages.

>> (I didn't write this script but I assume they did this for performance reasons.)

> For the same I'd rather do

> DIR_OF_SCRIPT=$(dirname "$0") && test -d "$DIR_OF_SCRIPT" || exit 1

>> But anyway, as you can see ${0} always exists.

> $ dash -c 'echo $0; for a; do echo "arg: $a"; done'
> dash
> $ dash -c 'echo $0; for a; do echo "arg: $a"; done' bla
> bla
> $ dash -c 'echo $0; for a; do echo "arg: $a"; done' bla foo
> bla
> arg: foo
> $ dash -c 'echo $0; for a; do echo "arg: $a"; done' -- bla foo
> --
> arg: bla
> arg: foo

> Kind regards

> robert



--
WBR,
Andrey Repin (anrdaemon@yandex.ru) 17.09.2013, <16:58>

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

