Re: Change PS1 when running as administrator

2014-06-17 Thread Eric Blake
On 06/17/2014 11:19 AM, Ernie Rael wrote: > On 6/17/2014 9:34 AM, Andrey Repin wrote: > >>> [[ $(id -G) =~ \b544\b ]] >>> was suggested (the suggestion used symbolic name instead of a number and >>> didn't use word boundary). Seems like word boundary is needed, but I >>> couldn't get this to

Re: Change PS1 when running as administrator

2014-06-17 Thread Eric Blake
On 06/17/2014 10:21 AM, Ernie Rael wrote: > On 6/17/2014 1:45 AM, GrahamC wrote: >> If we are looking for other alternatives the GROUPS environment >> variable can also be used: >> >> PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$ ' >> for G in "${GROUPS[@]}"; do >> if [ "$G" =

Re: Change PS1 when running as administrator

2014-06-17 Thread Ernie Rael
On 6/17/2014 9:34 AM, Andrey Repin wrote: [[ $(id -G) =~ \b544\b ]] was suggested (the suggestion used symbolic name instead of a number and didn't use word boundary). Seems like word boundary is needed, but I couldn't get this to work. Are the regex boundary matchers not supported by bas

Re: Change PS1 when running as administrator

2014-06-17 Thread Andrey Repin
Greetings, Ernie Rael! > On 6/17/2014 1:45 AM, GrahamC wrote: >> If we are looking for other alternatives the GROUPS environment variable can >> also be used: >> >> PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$ ' >> for G in "${GROUPS[@]}"; do >> if [ "$G" = 544 ]; then >>

Re: Change PS1 when running as administrator

2014-06-17 Thread Ernie Rael
On 6/17/2014 1:45 AM, GrahamC wrote: If we are looking for other alternatives the GROUPS environment variable can also be used: PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$ ' for G in "${GROUPS[@]}"; do if [ "$G" = 544 ]; then PS1='\[\e]0;Administrator \w\a\]\n\[\

Re: Change PS1 when running as administrator

2014-06-17 Thread GrahamC
> Frank Fesevur writes: >> When I run as administrator I change my PS1 from "$" to "#" with these >> line in ~/.bashrc. >> >> if id -Gn | grep -i Administrators > /dev/null > > If anything I'd check for membership in group 544.  "Administrators" > surely is one of these strings that gets localized

Re: Change PS1 when running as administrator

2014-06-17 Thread Achim Gratz
Thomas Wolff towo.net> writes: > As Corinna had said. Yet, I'd like to check official documentation to > confirm "544" is a constant for this purpose. I suggest you go to MSDN and search for "well-known security identifiers" and then read Corinnas explanation of how these are mapped to Cygwin UI

Re: Change PS1 when running as administrator

2014-06-16 Thread Thomas Wolff
Am 16.06.2014 22:04, schrieb Frank Fesevur: 2014-06-16 21:06 GMT+02:00 Achim Gratz: Frank Fesevur writes: When I run as administrator I change my PS1 from "$" to "#" with these line in ~/.bashrc. if id -Gn | grep -i Administrators > /dev/null If anything I'd check for membership in group 544

Re: Change PS1 when running as administrator

2014-06-16 Thread Frank Fesevur
2014-06-16 21:06 GMT+02:00 Achim Gratz: > Frank Fesevur writes: >> When I run as administrator I change my PS1 from "$" to "#" with these >> line in ~/.bashrc. >> >> if id -Gn | grep -i Administrators > /dev/null > > If anything I'd check for membership in group 544. "Administrators" > surely is o

Re: Change PS1 when running as administrator

2014-06-16 Thread Frank Fesevur
2014-06-16 21:00 GMT+02:00 Chris J. Breisch: > You might want to look at this thread: > https://sourceware.org/ml/cygwin/2014-04/msg00256.html Thanks for showing this threads. Missed it back then. > I use the registry test, but the id method would also work. I think the id command is a better wa

Re: Change PS1 when running as administrator

2014-06-16 Thread Achim Gratz
Frank Fesevur writes: > When I run as administrator I change my PS1 from "$" to "#" with these > line in ~/.bashrc. > > if id -Gn | grep -i Administrators > /dev/null If anything I'd check for membership in group 544. "Administrators" surely is one of these strings that gets localized depending o

Re: Change PS1 when running as administrator

2014-06-16 Thread Chris J. Breisch
GrahamC wrote: On Monday, 16 June 2014, 12:25, Frank Fesevur wrote: Hi, I recently bought a new home computer, so I switched from XP to Win81. With Win81 every now and then I need to start cygwin as administrator (right click shortcut or tile, run as administrator) to do things that I can't