Shell Scripting: What Is Kernel?
Shell Scripting: What Is Kernel?
Shell Scripting
➢ Shell script file means, a file which contains a set of commands with in it .
➢ If any file contains commands then that file can be executable file .
➢ Shell scripts can be useful to execute the set of commands at a single moment of
time .
What is kernel?
✓Kernel is hart of Linux Os. It manages resource of Linux Os. Resources means
facilities available in Linux. For e.g. Facility to store data, print data on printer,
memory, file management etc
✓ Kernel decides who will use this resource, for how long and when. It
runs your programs (or set up to execute binary files).
✓ I/O management
✓ Process management
✓ Device management
✓ File management
✓ Memory management
Uses of shells :-
➢ Customizing your work enviroments .
➢ Automating your daily tasks .
➢ Automating repetitive tasks .
➢ Executing important system produce like shutting down the file system .
➢ Performing same operating on many files.
``````
Type of shells :-
1. The bourne shell
2. The C shell
3. The korn shell
Bourne shell :-
• The original UNIX shell is known as sh, short for shell or the Bourne shell,
named for steven Bourne , the creator of sh.Bourne shell has considered a
standard part of UNIX for decades .
• The shell prompt is $, Execution command sh .
The C shell :-
• Designed by bill joy at the university of California at Berkeley, the C shell
was so named because much of its syntax parallels that of the C
programming language.
• The shell prompt is % and execution command Csh .
Shell variables :-
Variable is data name and it is used to store value .
Variable value can change during execution of the program .
permanent )
# env
# set | less
# echo $HISTFILE
# echo $UID
# echo $HOSTNAME
``````
# echo $HOME
# echo $LOGNAME
# echo $USER
EX:-
# x=5
# echo $x ( To check user defined value )
Shell keywords
Shell Keywords
Echo Esac
If Eval
Read Break
Else Exec
Set Continue
If Read-only
Unset While
Until Do
Trap Ulimit
Case Shift
Wait Exit
Done Umask
``````