When is bashrc executed
Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Learn more. What is the difference between. Ask Question. Asked 9 years, 6 months ago.
Active 1 year, 6 months ago. Viewed k times. Improve this question. Not to discourage the unix knowledge here, but bash is a pure UNIX beast so you might get better knowledge or have this question answered several times over on a partner site.
There is. See this question on Stack Overflow. This also gives you Bash 4 goodies Add a comment. Active Oldest Votes. Improve this answer. Alex Alex 8, 3 3 gold badges 19 19 silver badges 36 36 bronze badges. On OS X, Terminal by default runs a login shell every time - I have always been so confused by not realizing this. That program is a shell, i.
It's a command line shell: you start another program by typing its name. Bash is a Bourne-like shell. You can invoke a shell directly at any time, for example by launching a terminal emulator inside a GUI environment. When you start bash as an interactive shell i. This is mostly a concern if you want your initialization files to work on multiple machines and your login shell isn't bash on all of them.
If it's not, there's usually another place where you can define environment variables and programs to launch when you log in, but there is unfortunately no standard location. Both are bad ideas. The most common problem with either of these ideas is that your environment variables will only be set in programs launched via the terminal, not in programs started directly with an icon or menu or keyboard shortcut.
Feel free to forget it exists. From this short article. According to the bash man page,. When you login eg: type username and password via console, either physically sitting at the machine when booting, or remotely via ssh:. But, if you've already logged into your machine and open a new terminal window xterm inside Gnome or KDE, then.
Back in the old days, when pseudo tty's weren't pseudo and actually, well, typed, and UNIXes were accessed by modems so slow you could see each letter being printed to your screen, efficiency was paramount. To help efficiency somewhat you had a concept of a main login window and whatever other windows you used to actually work. In your main window, you'd like notifications to any new mail, possibly run some other programs in the background.
To support this, shells sourced a file. This would do the special, once a session setup. Bash extended this somewhat to look at. Other shells, non-login, would just source the rc file,. This is a bit of an anachronism now. You don't log into a main shell as much as you log into a gui window manager. There is no main window any different than any other window. My suggestion - don't worry about this difference, it's based on an older style of using unix.
Eliminate the difference in your files. The entire contents of. Remember that. You can short circuit the sourcing for non-interactive shells by putting this code near the top of. Have a look at this excellent blog post by ShreevatsaR. Ubuntu Community Ask! Sign up to join this community.
The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Learn more. Asked 2 years, 5 months ago. Active 2 years, 5 months ago. Viewed 1k times. Muthu August 17, , pm. Anonymous September 13, , am. Sylar December 1, , am. Cesar March 27, , am. Anonymous March 30, , am. TYVM for this excellent article!
Helped very much! I will be posting instruction guides, how-to, troubleshooting tips and tricks on Linux, database, hardware, security and web. My focus is to write articles that will either teach you or help you resolve a problem. Read more about Ramesh Natarajan and the blog.
0コメント