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 DFE373858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=inf.ed.ac.uk Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=inf.ed.ac.uk To: Subject: Re: CygwinPaltform Identification References: <337301d81d37$7afda680$70f8f380$@gmail.com> From: "Henry S. Thompson" Date: Wed, 09 Feb 2022 09:12:12 +0000 In-Reply-To: (Brian Inglis's message of "Tue\, 8 Feb 2022 18\:46\:07 -0700") Message-ID: User-Agent: Gnus/5.101 (Gnus v5.10.10) XEmacs/21.5-b34 (linux) MIME-Version: 1.0 X-Edinburgh-Scanned: at seine.is.ed.ac.uk X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham 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 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" 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=... ht -- Henry S. Thompson, School of Informatics, University of Edinburgh 10 Crichton Street, Edinburgh EH8 9AB, SCOTLAND -- (44) 131 650-4440 Fax: (44) 131 650-4587, e-mail: ht AT inf DOT ed DOT ac DOT uk URL: http://www.ltg.ed.ac.uk/~ht/ [mail from me _always_ has a .sig like this -- mail without it is forged spam] The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. -- 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