Is this supposed to work this way?

Buchbinder, Barry (NIH/NIAID) [E]
Tue Apr 3 21:47:00 GMT 2012

Andrey Repin sent the following at Tuesday, April 03, 2012 3:21 PM
>[Z:\]$ assoc .sh
>[Z:\]$ ftype unixshell.script
>unixshell.script="C:/Programs/Cygwin/bin/env.exe" "%1" %*
>++ readlink -fn 'Z:\'
>+ XXX='/z/Z:\'
>+ echo '/z/Z:\'
>++ dirname '/z/Z:\'
>+ XXX=/z/Z:
>+ echo /z/Z:
>+ ls -l /z/Z:
>ls: cannot access /z/Z:: No such file or directory
>The "" 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?

Is there a reason that something like the following wouldn't work?

if [ -f /bin/cygwin1.dll ]

>Sorry for my terrible english...

Not at all terrible.

Best wishes,

- Barry
  Disclaimer: Statements made herein are not made on behalf of NIAID.

Problem reports:
Unsubscribe info:

More information about the Cygwin mailing list