From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22153 invoked by alias); 11 Apr 2014 20:08:17 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 22002 invoked by uid 89); 11 Apr 2014 20:08:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.2 required=5.0 tests=AWL,BAYES_50,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mailout01.t-online.de Received: from mailout01.t-online.de (HELO mailout01.t-online.de) (194.25.134.80) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 11 Apr 2014 20:08:14 +0000 Received: from fwd08.aul.t-online.de (fwd08.aul.t-online.de [172.20.26.151]) by mailout01.t-online.de (Postfix) with SMTP id 4932B2CFFFC for ; Fri, 11 Apr 2014 22:08:05 +0200 (CEST) Received: from [192.168.2.108] (EYwZFiZeohwMbezg30ZFgd4DPjEtbDbRJGnynwdq2xLZwApz+p8Tl8YhztwxJODZiw@[84.180.79.214]) by fwd08.t-online.de with esmtp id 1WYhk1-49GtyC0; Fri, 11 Apr 2014 22:08:01 +0200 Message-ID: <53484B9F.4000300@t-online.de> Date: Fri, 11 Apr 2014 20:08:00 -0000 From: Christian Franke User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0 SeaMonkey/2.25 MIME-Version: 1.0 To: cygwin@cygwin.com Subject: Re: [PATCH] base-files-4.2-1: Change prompt if running with admin rights References: <53458036.1010307@t-online.de> <877g6ys69r.fsf@Rainer.invalid> <1187249515.20140410053930@yandex.ru> <534797B5.3080801@towo.net> In-Reply-To: <534797B5.3080801@towo.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2014-04/txt/msg00305.txt.bz2 Thomas Wolff wrote: > I use this in .bashrc (to embed $rootmark in an ESC sequence in PS1 > later). > I think it doesn't have specific dependencies and also it's portable > (except the group names are Windows ones...). It's not portable because Windows default user/group names are localized. > if id | grep -e "gid=.*(root)" -e "gid=.*(Administrators)" > /dev/null > then rootmark="30;41"; dirmark=7 > elif id | grep -e "gid=.*(Power Users)" > /dev/null German Windows uses "Administratoren", "Hauptbenutzer", "Domänen-Admins', ... > then rootmark="30;43"; dirmark=7 > else rootmark=0; dirmark="33;44" > fi > > Also I embed [$SHLVL] in PS1 unless it's 0, just as a suggestion. Makes sense. I vote +1 for the base-file's /etc/bash.bashrc :-) Christian -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple