X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 10A243851AB8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1692349198; bh=RU2HzNzKewxknqPPLaRJF9ps3KWmYzahw1oNQgHmi6I=; h=Subject:Cc:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=b16XKoO/hjiuob8Bq9uri+bcsHDBaeFdElpfHsChnbQII3OJ3gDDp1aNDedas8bZr F9+oJcxH44N5UdcqDpzyikr1Epd0Cm/gjDl7odH61KRcfH1CC5tulnkVKXWcW4c46j c8i6Ym5pEN0awGD7LVmV8aJnDFQkqGhWb1cA3NNI= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BE6EB385B512 Subject: Re: Test for Windows Administrator permissions from Cygwin terminal|script? Cc: cygwin AT cygwin DOT com References: Message-ID: <72d8548f-e962-5572-d075-1e7dbb38ea14@maxrnd.com> Date: Fri, 18 Aug 2023 01:59:35 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0 SeaMonkey/2.49.4 MIME-Version: 1.0 In-Reply-To: X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, MISSING_HEADERS, NICE_REPLY_A, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: , From: Mark Geisert via Cygwin Reply-To: Mark Geisert Content-Type: text/plain; charset="utf-8"; Format="flowed" Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 37I8xwR7016758 Mark Geisert via Cygwin wrote: > Backwoods BC via Cygwin wrote: [...] >> I don't know if this is the official method, but it works for me: >> >> ##### Shell Options >> # Elevated privilege windows have $SESSIONNAME set >> if [ "$SESSIONNAME" == "" ] ;then >>    printf -v adminPmt '[\u2022Admin\u2022] ' >> else >>    export adminPmt="" >> fi > > I see the opposite on my machine.  Admin window has empty $SESSIONNAME, non-Admin > window has "Console". Feh, I mentally reversed the 'if' clauses. I see the same $SESSIONNAME behavior on my machine. Sorry for the noise. ..mark -- 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