This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Is this supposed to work this way?
- From: Andrey Repin <anrdaemon at freemail dot ru>
- To: All <cygwin at cygwin dot com>
- Date: Tue, 3 Apr 2012 23:20:47 +0400
- Subject: Is this supposed to work this way?
- Reply-to: Andrey Repin <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@freemail.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