Is this supposed to work this way?
Andrey Repin
anrdaemon@freemail.ru
Tue Apr 3 19:35:00 GMT 2012
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
More information about the Cygwin
mailing list