|
|
Logout from OS X via the Terminal
There are basically two diffrenet types of shell invocation. A shell can be a login shell or it can be an interactive shell.
Logout from OS X via the Terminal
Excellent post!
new Terminal windows run "login shells"
Whenerver you open a new terminal window in OS X, you are invocating your shell implicitly as an interactive shell. Logout in this circumstance just doesn't make any sense - speaking from a unix standpoint of view.Actually, each new Terminal window starts a "login shell". You can see this by looking at the parent process of the shell - it is 'login'. This is important to know because it means that, for example, bash does not read the ~/.bashrc file when a new Terminal window is opened, but it does read the ~/.profile file (see 'man bash'). And this is the reason why typing 'logout' in a Terminal window will close that window, while 'exit' merely quits the shell and leaves the window open. If you start a sub-shell by typing 'bash' in a Terminal window, then that sub-shell is a non-login shell and so 'logout' gives you an error message. In contrast, a new xterm window starts a non-login shell.
new Terminal windows run "login shells"
> 'exit' merely quits the shell and leaves the window open |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.09 seconds |
|