delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2022/02/09/05:02:39

X-Recipient: archive-cygwin AT delorie DOT com
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5123C3858433
Authentication-Results: sourceware.org; dmarc=none (p=none dis=none)
header.from=SystematicSw.ab.ca
Authentication-Results: sourceware.org;
spf=none smtp.mailfrom=systematicsw.ab.ca
X-Authority-Analysis: v=2.4 cv=OO00YAWB c=1 sm=1 tr=0 ts=62039118
a=oHm12aVswOWz6TMtn9zYKg==:117 a=oHm12aVswOWz6TMtn9zYKg==:17
a=IkcTkHD0fZMA:10 a=pGLkceISAAAA:8 a=dp8IJY2vRo3mJ6cMNhkA:9 a=QEXdDO2ut3YA:10
a=nUPFJN98nyAA:10 a=6f4D53VNOn0A:10 a=Vd-B6qevKKAAeoahaDC9:22
Message-ID: <9681d035-0ce6-83aa-94b8-5a7c30c8e09a@SystematicSw.ab.ca>
Date: Wed, 9 Feb 2022 03:01:59 -0700
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.6.0
Subject: Re: Cygwin Platform Identification
To: cygwin AT cygwin DOT com
References: <337301d81d37$7afda680$70f8f380$@gmail.com>
<f2da839b-5304-2c5d-9e5b-083fadfe3768 AT SystematicSw DOT ab DOT ca>
<f5by22kqu8j DOT fsf AT ecclerig DOT inf DOT ed DOT ac DOT uk>
From: Brian Inglis <Brian DOT Inglis AT SystematicSw DOT ab DOT ca>
Organization: Systematic Software
In-Reply-To: <f5by22kqu8j.fsf@ecclerig.inf.ed.ac.uk>
X-CMAE-Envelope: MS4xfEeo0ckS/DJDoYJ0XeoDz9SM42KJLs7C7o67OxGel3KQOMKDSTU3DDgVZPatF1LLoBHztHZbW7xCollViFeJ1QLCjB0RwRxVdl0aIxclpzkEGNV4DNmk
RYsQ4wKdOdpHEmhzwcKFAddffPCpB5cBOsa/Yo0KmKukCkweBCvVvWRK9nGbky7yFfox1p1IviOsnKiQLUxPiQbwvRrdfXhYrFk=
X-Spam-Status: No, score=-1163.3 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS,
KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,
SPF_HELO_NONE, SPF_NONE, TXREP,
T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4
X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
Reply-To: cygwin AT cygwin DOT com
Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>

On 2022-02-09 02:12, Henry S. Thompson wrote:
> Brian Inglis writes:
> 
>> On 2022-02-08 15:01, julie77793 AT gmail DOT com wrote:
>>> Cygwin doesn't create an environment variable in bash to indicate that the
>>> platform is Cygwin under Windows.
>>> ...
>>
>> I have been switching env/OS/arch/triple dependent profile and rc files
>> and sections for years with:
>>
>> 64 $ echo $OSTYPE $OS $HOSTTYPE $MACHTYPE
>> cygwin Windows_NT x86_64 x86_64-unknown-cygwin
>> ...
> 
> When I don't know or can't remember what variable has the information
> I want, printenv is my first stop, e.g.
> 
>    64> printenv | grep -i cygwin
>    Cygwin=server
>    PATH=...
> 
> As Brian pointed out, that doesn't find what you need, because it only
> lists environment variables, but this does:
> 
>    64> declare -p | grep -i cygwin
>    declare -ar BASH_VERSINFO=([0]="4" [1]="4" [2]="12" [3]="3" [4]="release" [5]="x86_64-unknown-cygwin")
>    declare -x Cygwin="server"
>    declare -- MACHTYPE="x86_64-unknown-cygwin"
>    declare -- OSTYPE="cygwin"
>    declare -x PATH=...

AKA `set` in most shells:

$ set | egrep -i '=[^/\\]*(cygwin|windows)'
BASH_VERSINFO=([0]="4" [1]="4" [2]="12" [3]="3" [4]="release" 
[5]="x86_64-unknown-cygwin")
MACHTYPE=x86_64-unknown-cygwin
OS=Windows_NT
OSTYPE=cygwin
XDG_CURRENT_DESKTOP=X-Cygwin
$ env | egrep -i '=[^/\\]*(cygwin|windows)'
OS=Windows_NT
XDG_CURRENT_DESKTOP=X-Cygwin

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in binary units and prefixes, physical quantities in SI.]

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019