Test for Windows Administrator permissions from Cygwin terminal|script?

Mark Geisert mark@maxrnd.com
Fri Aug 18 08:59:35 GMT 2023


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


More information about the Cygwin mailing list