What is the difference between a “login” shell and a “non-login” shell?
When you start a new Terminal window, the shell that is started is a “login shell”. (It is called this because historically, this the shell that is started when a user logged in to a text-only Unix machine.) When you start a sub-shell (by typing a shell’s name at the command-prompt), you get a “non-login shell”. When you open a new ‘xterm’ window (under Apple’s X11), the shell that you get is a “non-login shell”. This is a key difference between Terminal and xterm and (as explained below) affects what startup files are read. Another difference between shells is “interactive” versus “non-interactive”. An “interactive” shell is the type that you interact with in a Terminal window. But when you run a shell script, a new shell is started for the purpose of that script, and that new shell is a “non-interactive” shell (since the user is not interacting with it via the command-prompt).