Change PS1 when run as administrator

Warren Young wyml@etr-usa.com
Tue Mar 15 19:23:00 GMT 2016


On Mar 15, 2016, at 12:37 PM, Achim Gratz <Stromeko@nexgo.de> wrote:
> 
> Warren Young writes:
> 
>> Perhaps something like this should go into the default /etc/profile?
> 
> No, since it gets read for all shells, not just interactive ones.

Not according to the INVOCATION section of bash.1.  It only talks about /etc/profile in the context of login shells.

Proof:

    $ echo 'echo re-sourced /etc/profile' >> /etc/profile
    $ bash
    $ ( ls )

> you can always
> place a script to that effect into /etc/profile.d if you absolutely want
> it there anyway.

I’ve been putting it in .bash_profile, which, like /etc/profile, is only sourced once when an interactive shell is started.

It would just be nice not to have to make this local tweak on every Cygwin installation.

Even if you don’t like my green -> red change, I do think the default PS1 should switch from $ to # when run as admin.

> I think putting these in the ENV file is preferrable.

I don’t know what you mean by that.


--
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



More information about the Cygwin mailing list