public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Christian Franke <Christian.Franke@t-online.de>
To: cygwin@cygwin.com
Subject: Re: [PATCH] base-files-4.2-1: Change prompt if running with admin rights
Date: Fri, 11 Apr 2014 20:08:00 -0000	[thread overview]
Message-ID: <53484B9F.4000300@t-online.de> (raw)
In-Reply-To: <534797B5.3080801@towo.net>

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

      reply	other threads:[~2014-04-11 20:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-09 17:15 Christian Franke
2014-04-09 18:32 ` Achim Gratz
2014-04-09 21:51   ` Christian Franke
2014-04-10  8:11     ` Corinna Vinschen
2014-04-10 15:36       ` Achim Gratz
2014-04-10 15:57       ` Christian Franke
2014-04-10  1:50   ` Andrey Repin
2014-04-11  7:20     ` Thomas Wolff
2014-04-11 20:08       ` Christian Franke [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53484B9F.4000300@t-online.de \
    --to=christian.franke@t-online.de \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).