X-Recipient: archive-cygwin AT delorie DOT 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 AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT 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 Reply-To: Andrey Repin Message-ID: <337763713.20130917170010@mtu-net.ru> To: Robert Klemme , cygwin AT cygwin DOT com Subject: Re: cygpath -m behaviour change In-Reply-To: References: 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 AT yandex DOT 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