Re: Bash initialization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Konsole is a terminal program out of KDE/Plasma.  Similar to 'xterm' of old. The terminal program of choice along the way invokes bash, which goes through its initialization routine. .bash_profile is accomplished upon login, where as opening a terminal session isn't a 'login' event.  There are really good reasons to know and promote good user-account hygiene, both for yourself, other users, and the enterprise as a whole.

Yes, PS1 should be modified in .bashrc; while adding elements to the end of the PATH variable should be accomplished in .bash_profile.  There are other distinctions as well, but those are the ones touched on in this thread.

R,
-Joe



On Thursday, December 12, 2024 at 02:35:58 AM EST, Stephen Morris <steve.morris.au@xxxxxxxxx> wrote:


On 12/12/24 14:02, Tim via users wrote:
On Thu, 2024-12-12 at 09:27 +1100, Stephen Morris wrote:
Just relative to this, with konsole, which is a bash shell
apparently, are you saying that when you create a new tab that
.bashrc is run in the new tab, but .bash_profile is not and is only
run at the initial console startup?
You can test this for yourself.  Put something extra in it.  Start up a
new console, see if it affects the new console.

e.g. stick into one of them an

 alias grr='echo grr'

And something different into the other one.  You'll either get a
command not found error, or it'll growl back at you.

I can see that each new shell window is affected by the modified
~/.bashrc but not by the modified ~/.bash_profile.  I have to start a
new logon before it the ~/.bash_profile has an effect.

NB:  I'm doing this on Mate, but the principle will be similar with
other consoles.  Of course there could be some that do things their own
way.
 

I have added a PS1 setting into .bashrc, which gets set in every new tab opened in console, but I don't have anything in .bash_profile as I've never used it, I was just querying how it worked.

regards,
Steve



    

-- 
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux