0% found this document useful (0 votes)
77 views

Shell Scripting: What Is Kernel?

The document discusses shells in Linux operating systems. It defines shells as command line interpreters that execute commands from standard input or files. Shells allow users to customize their environment, automate tasks, and execute system processes. The main types of shells are Bourne, C, and Korn shells. The kernel acts as an intermediary between hardware and programs, managing resources like memory, processes, files and devices. Shells are responsible for ensuring commands are properly executed. Variables can be defined by users or systems to store values that can change during program execution.

Uploaded by

Suraj Belgaonkar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
77 views

Shell Scripting: What Is Kernel?

The document discusses shells in Linux operating systems. It defines shells as command line interpreters that execute commands from standard input or files. Shells allow users to customize their environment, automate tasks, and execute system processes. The main types of shells are Bourne, C, and Korn shells. The kernel acts as an intermediary between hardware and programs, managing resources like memory, processes, files and devices. Shells are responsible for ensuring commands are properly executed. Variables can be defined by users or systems to store values that can change during program execution.

Uploaded by

Suraj Belgaonkar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

``````

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).

✓The kernel acts as an intermediary between the computer


hardware and various programs/application/shell
``````

It's Memory resident portion of Linux. It performance following task:

✓ I/O management

✓ Process management

✓ Device management

✓ File management

✓ Memory management

Shell is a user program or it's environment provided for user interaction.


Shell is an command language interpreter that executes commands read from
the standard input device (keyboard) or from a file.

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 .

The KORN Shell :-


• The korn shell because one of the main salvos in in AT & T Bell
response to the growing popularity of BSD Unix .
• Created by David Korn at AT & T Bell Laboratories, the KORN sell or
ksh, the prompt is $ .

Responsibilities of the shell :-


The shell is ultimately responsible for manking sure that any commands typed at the
prompt get properly executed
``````

The following are the responsibilities of shell .


1. Program Execution
2. Variable and file substitution
3. I/O redirection
4. Environment control
5. Interpreted programming language

Shell variables :-
Variable is data name and it is used to store value .
Variable value can change during execution of the program .

Variables are two types :-


1. System defined variables (SDV)
2. User defined variables (UDV)

System defined variables :-


Created and maintained by Linux it self.
This type of variable defined in CAPITAL LETTERS.
EX:-
# set ( Show all the variables Temporary and

permanent )

# env

Show only permanent variables : -


# printenv

# set | less

# echo $HISTFILE

# echo $UID

# echo $HOSTNAME
``````

# echo $HOME
# echo $LOGNAME
# echo $USER

User defind variables :-


➢ Created and maintained by user.
➢ This type of variable defined in lower letters.

EX:-

# x=5
# echo $x ( To check user defined value )

# unset x ( To delete 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
``````

You might also like