Is this supposed to work this way?

Eric Blake eblake@redhat.com
Wed Apr 4 00:57:00 GMT 2012


On 04/03/2012 06:47 PM, Andrey Repin wrote:
> Greetings, Buchbinder, Barry (NIH/NIAID) [E]!
> 
>> Is there a reason that something like the following wouldn't work?
> 
>> if [ -f /bin/cygwin1.dll ]
> 
> Hm. Turned out, this is more reliable check, than
> test "$OSTYPE" = "cygwin" && ...
> 
> But, oh, so much for consistency...
> 
> Question to Cygwin staff: shouldn't $OSTYPE be declared for Cygwin programs,
> even if they are not started from Cygwin shell? Is this at all possible?

No, not possible - $OSTYPE is not standardized, so there's no point in
expecting cygwin to provide it (of course, you can export it in your
~/.bashrc).  Furthermore, even if cygwin exported it, the moment your
cygwin process starts a non-cygwin process, that process would also see
the same setting.

-- 
Eric Blake   eblake@redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://cygwin.com/pipermail/cygwin/attachments/20120404/e0c80b1c/attachment.sig>


More information about the Cygwin mailing list