delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2023/08/18/05:00:03

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: <CANH4o6OpsvT99AeJ2uTcqyajWQHmffYJqV=RR4HBxoFaveR7sQ AT mail DOT gmail DOT com>
<CAKwdsS_Q93_Z0E2cM2iw+DZRvB0DaR6YSi9frod_uh7aoCMxUA AT mail DOT gmail DOT com>
<a1d6ff78-2b87-9111-8339-f0ce6d6050cd AT maxrnd DOT com>
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: <a1d6ff78-2b87-9111-8339-f0ce6d6050cd@maxrnd.com>
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
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>
From: Mark Geisert via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Mark Geisert <mark AT maxrnd 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>
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

- Raw text -


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