login shell and interactive shell?

Can anyone tell me what are login shell and interactive shell and which configurations each of them read(etc/profile, etc/bashrc, .bash_profile ...)??

I saw some explanation like this: A login shell is one whose first character of argument zero is a -, or one started with the --login option. An interactive shell is one started without non-option arguments and without the -c option whose standard input and error are both connected to terminals (as determined by isatty(3)), or one started with the -i option. PS1 is set and $- includes i if bash is interactive, allowing a shell script or a startup file to test this state.

But this confused more !!!

Answers


The man bash command on your system (INVOCATION section) talks about all of this and it describes which files are read when.


Well, if you don't trust the manual page, try using strace.

strace -o/tmp/tr -f bash
exit
grep open /tmp/tr | grep $HOME

For me, this shows:

18316 open("/home/sethrobertson/.bashrc", O_RDONLY) = 3

What does it show for you?


Need Your Help

How to quickly replace a Maven Dependency with an Eclipse project?

java eclipse maven jar m2eclipse

I have setup a Dynamic Web Project in Eclipse using Maven. The Web Project has a lot of dependencies to other JARs. The JARs are properly added to the WEB-INF/lib folder in Maven/Eclipse. Many of the

Server doesn't parse php code fully

php apache server apache2

Since a few days my server doesn't parse my php code (not only the attached file) anymore. If I call the php file via a html file it will just load forever.