content









Content















 
Summary






Now that the student has completed
this chapter, the student should have an understanding of the
following:


The UNIX shell is a key component
of the UNIX operating system. The shell is the interface between
the user and the kernel. This chapter focused on the two most
popular shells used today, the Korn and Bash shells.


The default prompt for the Korn and
Bash shell is the dollar sign ($)
and can be customized by changing the value of the PS1 variable.


Both Korn and Bash shells support
aliases and history. Aliases allow the user to create new command
names and associate the new names with existing commands to
increase productivity. The history
command allows the user to repeat previous commands to avoid
having to type the commands again.


Additional features supported by
both the Korn and Bash shells include command line editing and
file name completion. Command line editing allows the user to use
vi editor commands to modify previous command lines. set
+o vi turns on both the
command line editing feature and file name completion. File name
completion saves typing time by entering the first few characters
of a file name then pressing the Esc and backslash keys (Esc\)
in sequential order for the Korn shell or the Tab key for
the Bash shell.


Variables are either local or
global. Local variable are available only in the current shell.
Global variables are exported to all subshells. To set a variable,
use the format VARIABLE=value.
To make it available to all subshells, export it with the export
command. To display the value of an individual variable, use the echo
$VARIABLE command. Use the set
command to display a list
of local variables, and use the export
command to display a list of all environment variables.


When a user logs into a UNIX
system, several initialization files are read and processed. These
files contain settings for variables that customize the user's
environment. Two types of initialization files exist, the system
wide and the user specific. The etc/profile file is the system
wide initialization file that affects all Korn and Bash shell
users. The /etc/profile file can perform the following:



Exports environment variables


Exports PATH for the default
command path


Sets the TERM variable default
terminal type


Displays the contents of the /etc/motd
file


Sets default file creation
permissions


Checks for mail



Two additional user specific
initialization files that are kept in the user's home directory
are .profile and .kshrc for Korn shell users and .bash_profile and
bash.rc for Bash shell users. These user specific files are read
after /etc/profile to provide additional customization for the
user's environment. The run control files, .kshrc for Korn shells
users and .bashrc for Bash shell users, are also read every time a
new shell is started or Terminal window is open. The user specific
initialization files can perform some or all of the following:



Set the default prompt


Define the default printer


Set default permissions


Set the default terminal


Set the new mail location


Set noclobber


Set the command path


Define aliases













Wyszukiwarka

Podobne podstrony:
content
content
content
content
content
content
content
content
content
function domnode get content
content
content
content
content
content
content

więcej podobnych podstron