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:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; q=dns; s=default; b=Fw dXeiwJwbjBcjLAMeH+NcEnnb0wyWFiHBA+WT88J/cRaGiZx883mT2j8aQF4YkJhY /S1FtLggVEF7J9avurDyxNk3+zY9H+vGV86qMc5d+GhhxtsmjlfQi4ofZM6/T3qr 5RDK5VfSnDi9mHdqyqOgnwDkrOX3yg1adFebYrtEM= 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:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; s=default; bh=2inYLT0D 6gYTvcXmplLtixTW5wI=; b=ZzQ2ajnqDMJGYwhd0LUOIbwF2tEwdLl1DxgnCX4i 7HVEXFEQ4HwBJuLfHmOT6/64shZmrR4mp7qP9BzpjOWgwo9sRgggjDXGj+UArRik WVirk1n9FHw7bmVmPKWL3Vkdt9R9q9CGzxNMWI+PgKM3SgbBdBjxilannKpjvd56 3Gk= 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=1.1 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,KHOP_THREADED,NO_RELAYS autolearn=ham version=3.3.2 X-HELO: mail-qe0-f47.google.com MIME-Version: 1.0 X-Received: by 10.49.105.1 with SMTP id gi1mr51970298qeb.8.1379409137164; Tue, 17 Sep 2013 02:12:17 -0700 (PDT) In-Reply-To: References: Date: Tue, 17 Sep 2013 11:12:17 +0200 Message-ID: Subject: Re: cygpath -m behaviour change From: Robert Klemme To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes On Mon, Sep 16, 2013 at 11:56 AM, David Griffiths wrote: >> 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 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 -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/ -- 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