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=ahjC0Hr+h27gi29a RZlNH5/M5DWqtSUoTaNNpqaiR3OKulTlH14ozL+9WLQ5uYWYP3ek+fPZfZAzeL/Z LnlW1Nd0CIqDf43RU2SiSPyaWjr1brzzJomhxEAiPoGNi8xMveXfOvAV+YYjWtJ3 zm+QXqT2x4pdLZ/zseQGYsuJpYs= 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=mXNOCQN+KNyMftPFHYmLEl yDjrQ=; b=addhZs39Z/DTBn9iDDUxsGdp3gLQ+ucujKxGeuiZ7rummNxAO/1rRB 6D1X1j4O6GH12NyvU4FnP0uzWFTpk0n3+S38VGzW0gp8EPPQ6kkcthTg1S071hHs kvv2hi71HFJSWe6Ht0VKu1/L+FM2baWu5MLz3O7bcN8Kjf3Q4pwgg= 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: Yes, score=6.2 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,FSL_HELO_BARE_IP_1,FSL_HELO_BARE_IP_2,HELO_MISC_IP,KAM_THEBAT,KHOP_THREADED,RDNS_NONE autolearn=no version=3.3.2 X-HELO: smtp.ht-systems.ru Date: Tue, 17 Sep 2013 00:45:56 +0400 From: Andrey Repin Reply-To: Andrey Repin Message-ID: <16710079158.20130917004556@mtu-net.ru> To: David Griffiths , 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, David Griffiths! >> 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 didn't write this script but I assume they did this for performance reasons.) Glad you didn't... Because otherwise you would be the one to blame for the problem. $0 could easily NOT have any path, just a script name. > But anyway, as you can see ${0} always exists. Only theoretically. Practice is that noone will bet a buck on it. > I looked at the other thread but don't see an immediate connection as > that was checking for non-existing path members. If you want to obtain a full name of a running script, you'd need something like this: XXX="$(cygpath -au "$0")" SCRIPT_NAME="$(readlink -fn "${XXX:-$0}")" This is almost platform-independent, even. To the extent of readlink -f option support. -- WBR, Andrey Repin (anrdaemon AT yandex DOT ru) 17.09.2013, <00:19> 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