vendo viagra levitra pharmacie achat tadalafil medicament cialis medicament viagra acheter cialis france cialis sur ordonnance cialis france levitra donne vendo cialis vente cialis cialis generique acquisto viagra italia viagra moins cher koop viagra levitra senza ricetta pastilla sildenafil pildoras cialis cialis prijs viagra verkauf cialis ricetta medica levitra venta viagra te koop acheter du cialis cialis meilleur prix levitra generico compro cialis acheter viagra zithromax generique cialis sur internet costo viagra comprar viagra pela internet viagra naturel acheter clomid en france acquistare levitra acheter du kamagra vente de cialis sur internet prix du viagra levitra prix achat de levitra levitra en pharmacie comprar vardenafil tadalafil 10 mg kamagra oral jelly viagra ordonnance acheter cialis generic compro viagra le viagra viagra recensioni cialis rezeptfrei cialis generico propecia sans ordonnance trouver du levitra impotenza rimedi cialis sur le net viagra svizzera prezzi viagra cialis preço zyban prix levitra venta libre viagra venta libre viagra pharmacie viagra donna viagra 100 mg cialis effetti collaterali kamagra rezeptfrei sildenafil sin receta viagra donne sildenafil bestellen costo levitra cialis kauf disfunzione erettile rimedi procurer du cialis achat pharmacie ordina viagra cialis vente libre viagra bestellen kamagra pharmacie viagra kosten viagra vendita italia viagra senza ricetta aquisto cialis acheter cialis pas cher propecia moins cher cialis vente libre pastilla viagra vardenafil 10 mg comprare levitra levitra 20 mg comprar cialis generico prozac prix cialis effet secondaire sildenafil rezeptfrei acquisto viagra net acheter cialis sur la net medicament levitra acquistare viagra sildenafil venta libre kamagra apcalis acheter kamagra vardenafil generika cialis pharmacie trouver du cialis viagra europe cialis quebec citrate de sildenafil tadalafil precio acheter cialis 20mg viagra vendita libera viagra 50 mg trouble erection cialis kopen comprar cialis levitra generico levitra en ligne acheter cialis en espagne viagra ricetta medica koop kamagra viagra europe levitra farmacia achat viagra acheter isotretinoine impotenza cure achat levitra levitra kopen compro levitra comprar levitra kamagra en france vardenafil bestellen comprar tadalafil achat cialis generique comprar sildenafil procurer du levitra

Command Post: Using the Shell *UPDATED*

Command Post is a series designed increase your understanding of a given command, it’s configuration files, usage and tips for exam questions about the command.

Understanding Shells

A shell is a program designed to interpret the commands users type, parse for expansions and wildcards, and then produce instructions to the computer to accomplish those tasks.

Unless you change the defaults, the Linux shell is normally the bash shell. Of course, many other shells exist. A partial list is shown in the following table.

linux_shells_table

Among other pieces of information, the user’s default shell is specified in the /etc/passwd entry for that user. If the shell that is specified does not exist, the user is not permitted to log in.

Special shells can be specified, such as /bin/false (which returns a nonzero error code, effectively blocking access by a user attempting to log in) or /etc/nologin (which is used to block logins for accounts that have been disabled and echo a message that login is denied). The /etc/nologin file might not exist on some systems.

Deconstructing a Login Shell Session

A login shell is one that is executed when logging in to the system. The /etc/profile file is the global configuration file that affects all users’ environments if they use the bash shell. It’s sourced (read) every time a user performs a login shell. This file is a script and is executed right before the user’s profile script.  The user’s ~/.bash_profile script, if it exists, is the next script that’s sourced.  This file contains variables, code, and settings that directly affect that user’s—and only that user’s—environment. This script calls, or sources, the next script, which is .bashrc.

The .bash_profile script can also be referred to or named as the .bash_login or .profile script. If all three exist, the .bash_profile is sourced alone; otherwise, if it doesn’t exist, the .bash_login is sourced. Finally, if the first two are nonexistent, the .profile script is sourced. This functionality is used almost entirely by Bourne shell users upgrading to a bash system as a way to keep their settings in the same .profile file.

The .bashrc file is called by the .bash_profile or one of the profile’s aliases and is used to set various shell settings and options, set the prompt, and define aliases and functions for command-line execution. The last script sourced during a user’s login session is the .bash_logout file. This file is used to issue the clear command, so text from any previous command is not left on the user’s screen after he logs out.

TIP: Be careful on the exam because a lot of test-takers do not pick the .bash_logout file as part of the user’s login session. It’s definitely one of the more missed elements in the shell section.

An example of the user’s login session might be the following:

1. The user logs in with a username and password.
2. The /etc/profile is sourced.
3. The user’s .bash_profile is sourced.
4. The user’s .bashrc is sourced from within the .bash_profile.
5. The user conducts his business.
6. The user initiates a logout with the logout or exit command or by
pressing Ctrl+D.
7. The user’s .bash_logout script is sourced.

Summary

Remember these important things:  1.  Executing a script file only loads the settings contained in it within the life of the sub-shell the script executes in, they are gone when the sub-shell exits.  2.  Sourcing a script file ( preceeding it with dot, such as ” .  /etc/bashrc” will load the variables and settings in that file into the current shell.

For more information on how to use the shell, you can turn to many multiple resources, including Chapter 2 of the current version of my LPIC 1 Exam Cram 2 book (look for it in the sidebar ->), starting on Pg 28, the second would be the bash shell’s man page (man bash), still another would be the Guides section of The Linux Document Project’s site, particularly the Bash Guide for Beginners.

Any comments, suggestions or questions are welcome.

RossB

Copyright 2000-2009 Ross Brunson


Leave a Reply

buy viagra internet Discount Viagra
cheap gerneric viagra