Shell Scripting
Shell Scripting
System
and
Shell Scripting
What is Kernel?
USER REQUEST
SHELL APPLICATI
ON
LINUX KERNEL
COMPUTER HARDWARE
Some LINUX commands
8 rm Delete files
Shell is a program that text commands type by the user and cause
the operating system to run those commands.
The shell is a program that acts as as the interface between you and
the Linux system allowing you to enter commands for the operating
system to execute shell.
Shell accept your instructions or command in English and translate
it into a computer native binary language.
Why to write Shell script?
2. Press the Esc key to switch Vi back to Command mode. As soon as we hit the
Esc key the text "INSERT on the bottom line disappears.
3. We have to save changes to the open file from the Command mode. Press Shift-
ZZ is save
IF statement.
CASE statement.
IF statement syntax:
if ((condition)) then
statements
else
statements
fi
Control Statements
case statement syntax:
case EXPRESSION in
Pattern_Case_1) STATEMENTS
;;
Pattern_Case_2) STATEMENTS
;;
Pattern_Case_N) STATEMENTS
;;
*) STATEMENTS
;;
esac
Looping statements in Shell script
There are total 3 looping statements that can be used in shell programming
while statement
for statement
until statement
To alter the flow of loop statements, two commands are used they are,
break
continue
while statement syntax
while <condition>
do
<command 1>
<command 2>
<etc>
done
for statement syntax
until <condition>
do
<command 1>
<command 2>
<etc>
done
Implementing for loop with break statement
Date Batches
16 DEC 2023 B1 (Rollno 1- 45)
19 DEC 2023 B2(Rollno 46-89)