Deutsch English Français Italiano |
<87a5dejb0e.fsf@example.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!weretis.net!feeder9.news.weretis.net!news.quux.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Wolfgang Agnes <wagnes@example.com> Newsgroups: comp.unix.bsd.freebsd.misc Subject: Re: which file should have my bash prompt, .profile vs .bashrc Date: Mon, 02 Dec 2024 13:38:25 -0300 Organization: A noiseless patient Spider Lines: 27 Message-ID: <87a5dejb0e.fsf@example.com> References: <874j3ml3q8.fsf@example.com> <vikadn$3b35f$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Mon, 02 Dec 2024 17:38:25 +0100 (CET) Injection-Info: dont-email.me; posting-host="679685da1d6daad20e67a8fab5e2e8b9"; logging-data="3623847"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1984AohqGdv50q537B9x2/aMEnR/40NcLA=" Cancel-Lock: sha1:Y4diHfDo/BA8COWmOvJvcN3XuW8= sha1:L4diXsZWwGXGK0NwyzZBphmj2q0= Bytes: 2116 Chris Elvidge <chris@internal.net> writes: > On 02/12/2024 at 11:32, Wolfgang Agnes wrote: >> I installed bash and have been trying to set up my prompt. I notice >> that if I add >> PS1='# '; export PS1 >> to my .profile, then I get the prompt when I log in, not when I >> /sudo >> su/ from a regular user. If I add >> PS1='# '; export PS1 >> to ~/.bashrc, then I get the prompt when I ``sudo su'', but not when >> I >> log in. I can add the prompt set up to both files, but I'm asking >> myself---how do you guys avoid such redundancy? (Thanks!) >> > > Put it in .bashrc and then call .bashrc from .profile (unless > .bash_profile exists; only for bash.) Is this how it's typically done? I thought that sourcing .profile, say, from .bashrc would destroy the purpose of having a separate thing for when logging in and another for interactive runs of the shell. Now realize I could make a library-script and source it from both scripts (.profile and .bashrc), but then I've never done that myself and so I was wondering how people do things. Anyway, thanks very much for sharing your side of things!