X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=2.5 required=5.0 tests=AWL,BAYES_20,FREEMAIL_FROM,KAM_THEBAT X-Spam-Check-By: sourceware.org Date: Tue, 3 Apr 2012 23:20:47 +0400 From: Andrey Repin Reply-To: Andrey Repin Message-ID: <725182483.20120403232047@mtu-net.ru> To: All Subject: Is this supposed to work this way? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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 Greetings, All! [Z:\]$ assoc .sh .sh=unixshell.script [Z:\]$ ftype unixshell.script unixshell.script="C:/Programs/Cygwin/bin/env.exe" "%1" %* [Z:\]$ testcase.sh ++ readlink -fn 'Z:\testcase.sh' + XXX='/z/Z:\testcase.sh' + echo '/z/Z:\testcase.sh' /z/Z:\testcase.sh ++ dirname '/z/Z:\testcase.sh' + XXX=/z/Z: + echo /z/Z: /z/Z: + ls -l /z/Z: ls: cannot access /z/Z:: No such file or directory The "testcase.sh" is very simple. #! /bin/sh set -x XXX=${XXX:=$(readlink -fn "$0")} echo $XXX XXX=$(dirname "$XXX") echo $XXX ls -l "$XXX" I can combat this by XXX=$(cygpath -alm "$0") XXX=${XXX:=$(readlink -fn "$0")} but then my script losing portability. (Namely, I can't "set -e" it then.) Any suggestions, perhaps? -- WBR, Andrey Repin (anrdaemon AT freemail DOT ru) 03.04.2012, <23:10> 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