This is the mail archive of the
mailing list for the Cygwin project.
Re: [PATCH] base-files-4.2-1: Change prompt if running with admin rights
- From: Christian Franke <Christian dot Franke at t-online dot de>
- To: cygwin at cygwin dot com
- Date: Fri, 11 Apr 2014 22:07:59 +0200
- Subject: Re: [PATCH] base-files-4.2-1: Change prompt if running with admin rights
- Authentication-results: sourceware.org; auth=none
- References: <53458036 dot 1010307 at t-online dot de> <877g6ys69r dot fsf at Rainer dot invalid> <1187249515 dot 20140410053930 at yandex dot ru> <534797B5 dot 3080801 at towo dot net>
Thomas Wolff wrote:
I use this in .bashrc (to embed $rootmark in an ESC sequence in PS1
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",
then rootmark="30;43"; dirmark=7
else rootmark=0; dirmark="33;44"
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 :-)
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple