.bashrc file is an initialization file run by each interactive invocation


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers .bashrc file is an initialization file run by each interactive invocation
# 1  
Old 05-23-2007
.bashrc file is an initialization file run by each interactive invocation

I search the web and found the following statements


.....
The /etc/profile file is a system wide initialization script which is run at login time for each user, while .profile is the users own login initialization. The .bashrc file is an initialization file run by each interactive invocation of the bash shell. My .bashrc simply sources the other two, so that all interactive shells get the same initialization. Aliases common to all users rest in /etc/profile, others go into .profile.
..........


as my limited knowledge to linux/unix, i do not follow what is "interative invocation of the bash shell". Could anyone please give me an example to this.

Thanks.
# 2  
Old 05-23-2007
/etc/profile and .profile (or indeed .bash_profile) are run when bash is called by the login process, This happens when you log on via a terminal or telnet or ssh or something similar.

.bashrc (and indeed /etc/bash.bashrc) are run when bash is called by any other method, for example if you logged on and then just type 'bash' or if you logged onto a graphical terminal and ran an xterm or if you ran a bash shell script from the command line.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. OS X (Apple)

A system deletes my .bashrc file

It deletes my .bashrc file rarely but predictability after some unknown count of Mac's restarts. Has someone ever faced such behavior? How do I prevent OS X from modifying .bashrc? What ownership/permission should I set up to not let it happen? OS X Lion. (6 Replies)
Discussion started by: scrutinizerix
6 Replies

2. UNIX for Dummies Questions & Answers

Bashrc File - Conditional Command Execution?

Hello All, I was wondering if there is a way to execute a command in my ".bashrc" file based on how I logged into the PC? I was thinking maybe there is a way to check how the user (*myself) logged in, maybe somehow with the who command along with something else, but I'm not sure... I know I... (7 Replies)
Discussion started by: mrm5102
7 Replies

3. Programming

Run interactive program in background and grep it

I need to run an interactive program in the background so I can grep it for specific data to use for some logic in a script. There is no quiet or background mode on the program so I plan to redirect a document with commands in it and then to grep the output. This is almost working, except... (1 Reply)
Discussion started by: doonan_79
1 Replies

4. Shell Programming and Scripting

Use expect to run an interactive shell script?

Hi all, I have a bit of a vexing issue here and I'm not certain how best to go about it. Basically, I want to run a shell script and automate the user prompt of hitting 1 to fully uninstall Symantec Anti-Virus for OS X. Would expect be the best way to do this? (5 Replies)
Discussion started by: prometheon123
5 Replies

5. Shell Programming and Scripting

Is command line invocation of gnome-terminal to run more than one command possible?

Hello, I am trying to learn how to pass something more than a one-command startup for gnome-terminal. I will give an example of what I'm trying to do here: #! /bin/bash # #TODO write this for gnome and xterm USAGE=" ______________________________________________ ${0##*/} run... (0 Replies)
Discussion started by: Narnie
0 Replies

6. Shell Programming and Scripting

.bashrc file

Hi experts, I am using bash shell and I cant find any .bashrc file in my home dir. Can anybody please help me out here.... If .bashrc file is not there, from where my shell config operates? Also I want to set my prompt like... $ Please advice. (5 Replies)
Discussion started by: gentleDean
5 Replies

7. Shell Programming and Scripting

how do i look for my .bashrc file

hi i am using cygwin and would like to modify my .bashrc file. How can search to find where it is? I have looked at multiple bashrc file in /etc but none of them seemed to work..thanks (12 Replies)
Discussion started by: npatwardhan
12 Replies

8. Shell Programming and Scripting

Can I modify the .bashrc file instead of .profile file to customize my login?

Hello, I got this question which tells me to customize my login script. Some people in the forums suggested to modify the .profile file in my home directory. I did so, but none of my customizations show up when I open the terminal after. So, I tried to modify other files in my home directory,... (1 Reply)
Discussion started by: Hyunkel
1 Replies

9. Shell Programming and Scripting

Need to run source .bashrc everytime

hi all, I've included some variables in my .bashrc file. But everytime i'm logging in i need to source my .bashrc file to make effect of my variables. i'm having an account on a highly secured production environment. I've the following in my ~/.bashrc file alias cls=clear How to make... (2 Replies)
Discussion started by: kalyanraj
2 Replies
Login or Register to Ask a Question