public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* RE: Is this supposed to work this way?
@ 2012-04-03 21:47 Buchbinder, Barry (NIH/NIAID) [E]
  2012-04-04  0:50 ` Andrey Repin
  0 siblings, 1 reply; 13+ messages in thread
From: Buchbinder, Barry (NIH/NIAID) [E] @ 2012-04-03 21:47 UTC (permalink / raw)
  To: cygwin

Andrey Repin sent the following at Tuesday, April 03, 2012 3:21 PM
>[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?

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

if [ -f /bin/cygwin1.dll ]
then
else
fi

>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:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 13+ messages in thread
* Is this supposed to work this way?
@ 2012-04-03 19:35 Andrey Repin
  2012-04-03 22:50 ` Andrey Repin
  0 siblings, 1 reply; 13+ messages in thread
From: Andrey Repin @ 2012-04-03 19:35 UTC (permalink / raw)
  To: All

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2012-04-05 22:50 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-03 21:47 Is this supposed to work this way? Buchbinder, Barry (NIH/NIAID) [E]
2012-04-04  0:50 ` Andrey Repin
2012-04-04  0:57   ` Eric Blake
2012-04-04  1:50     ` Andrey Repin
2012-04-04  3:57       ` Warren Young
2012-04-04  7:51         ` Csaba Raduly
2012-04-04  9:04         ` Andrey Repin
2012-04-04 13:30           ` Eric Blake
2012-04-04 18:09             ` Warren Young
2012-04-05 22:50             ` Andrey Repin
2012-04-04 12:29       ` Nellis, Kenneth
  -- strict thread matches above, loose matches on Subject: below --
2012-04-03 19:35 Andrey Repin
2012-04-03 22:50 ` Andrey Repin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).