SlideShare a Scribd company logo
NAME- RANJAN DAS
STUDENT CODE- BWU/BTA/22/508
DEPARTMENT- B.TECH CSE(AIML)
SEC- I
SEM- 4th
SUBJECT NAME- OPERATING
SYSTEM
SUBJECT CODE- PCC-CSM401
TOPIC NAME- SHELL
PROGRAMING
Contents
• Introduction
• Type of shells
• Shell scripting
• Basics of shell scripting
• Uses of shell scripting
WHAT IS A SHELL
A shell is a program that takes commands typed by the user
and calls the operating system to run those commands.
* A shell is a program that acts as the interface between you
and the Linux system, allowing you to enter commands for the
operating system to execute.
* Shell accepts your instruction or commands in English and
translate it into computers native binary language.
WHY WE USED SHELLS
We can use shell scripts to automate administrative tasks.
* Encapsulate complex configuration details.
* Get at the full power of the operating system.
* The ability to combine commands allows you to create new
commands
* Adding value to your operating system.
Types of shells
• Bourne shell
• C shell
• Korn shell
• Bash shell
• Tcsh shell
Shell Scripting
Shell scripting is a way to automate tasks using the command-
line shell of an operating system. The shell is a program that
interprets commands and acts as an intermediary between the
user and the operating system.
• It is a series of command stored in a plain text file.
• A Shell script is similar to a batch file in MS-DOS
but is much more powerful than that.
Basics of Shell Scripting:
• Shebang Line: Every shell script should begin with a
shebang line (#!) followed by the path to the shell interpreter.
For example, #!/bin/bash indicates that the script should
be executed using the Bash shell.
• Comments: Comments start with a # and are ignored by the
shell. They are used to add explanations or documentation to
the script.
• Variables: Variables are used to store data. They can be
defined and accessed using the $ symbol.
• Ex-
NAME="John"
echo "Hello, $NAME!"
Control structures
• Shell scripting supports various control structures like loops and
conditionals (if, else, elif, case). Here's an example of an if-else
statement.
• Ex- if [ "$NAME" == "John" ]; then
echo "Hello, John!"
else
echo "Hello, someone else!"
fi
# fi used to denote the end of a conditional block.
Functions
We can define functions to organize our code and reuse it.
We can perform various type of operation in a program using
functions.
Ex- greet() {
echo "Hello, $1!"
}
greet "Alice"
o/p- Hello, Alice.
Square() {
Local num=$1
Local result=$((num * num))
echo "The square of $num is: $result"
}
Square 5
o/p- The square of 5 is: 25
Examples where shell scripting can
be used:
• Monitoring Linux system
• Data backup & create snape shots.
• To find out available memory & free memory.
• Find out all necessary networks are running out or not.
Thank you

More Related Content

PPTX
Shell scrpting(payal harne)
PDF
Introduction to Shell Scripting: All About It
PPTX
Shell & Shell Script
PPTX
Shell & Shell Script
PPT
1 4 sp
PPT
Spsl by sasidhar 3 unit
ODP
Introduction to Shell script
PPT
Introduction to shell scripting ____.ppt
Shell scrpting(payal harne)
Introduction to Shell Scripting: All About It
Shell & Shell Script
Shell & Shell Script
1 4 sp
Spsl by sasidhar 3 unit
Introduction to Shell script
Introduction to shell scripting ____.ppt

Similar to BWU_BTA_22_508_cSd how os are implemented.pptx (20)

PPT
shell-programming.ppt
PDF
Shell scripting _how_to_automate_command_l_-_jason_cannon
PDF
Shell tutorial
PPTX
Shell scripting - Basic (PART -1)
PPTX
Licão 05 scripts exemple
PPT
Shell Scripting in Linux
PPTX
Linnux & Shell scripts Commands.pptx
PPTX
shell script programming introduction and fundamentals
PPTX
Shell Scripting and Programming.pptx
PPTX
Shell Scripting and Programming.pptx
PDF
3.1.d manual bash script guide lsstv 2.0r11
PPTX
Bash shell scripting
PDF
Introduction to Shell Scripting - RHCSA+.pdf
ODP
OpenGurukul : Language : Shell Scripting
PPT
Shell programming
PDF
Unix shell scripting tutorial
PDF
Shell Script Linux
PDF
Shell Programming_Module2_Part2.pptx.pdf
ODP
Shellscripting
shell-programming.ppt
Shell scripting _how_to_automate_command_l_-_jason_cannon
Shell tutorial
Shell scripting - Basic (PART -1)
Licão 05 scripts exemple
Shell Scripting in Linux
Linnux & Shell scripts Commands.pptx
shell script programming introduction and fundamentals
Shell Scripting and Programming.pptx
Shell Scripting and Programming.pptx
3.1.d manual bash script guide lsstv 2.0r11
Bash shell scripting
Introduction to Shell Scripting - RHCSA+.pdf
OpenGurukul : Language : Shell Scripting
Shell programming
Unix shell scripting tutorial
Shell Script Linux
Shell Programming_Module2_Part2.pptx.pdf
Shellscripting
Ad

Recently uploaded (20)

PDF
Event Presentation Google Cloud Next Extended 2025
PDF
creating-agentic-ai-solutions-leveraging-aws.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
PPTX
Web Security: Login Bypass, SQLi, CSRF & XSS.pptx
PDF
REPORT: Heating appliances market in Poland 2024
PDF
AI And Its Effect On The Evolving IT Sector In Australia - Elevate
PDF
Chapter 2 Digital Image Fundamentals.pdf
PDF
CIFDAQ's Token Spotlight: SKY - A Forgotten Giant's Comeback?
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Modernizing your data center with Dell and AMD
PDF
Sensors and Actuators in IoT Systems using pdf
PDF
ai-archetype-understanding-the-personality-of-agentic-ai.pdf
PDF
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
GamePlan Trading System Review: Professional Trader's Honest Take
PDF
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
PDF
Top Generative AI Tools for Patent Drafting in 2025.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
HCSP-Presales-Campus Network Planning and Design V1.0 Training Material-Witho...
Event Presentation Google Cloud Next Extended 2025
creating-agentic-ai-solutions-leveraging-aws.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
Web Security: Login Bypass, SQLi, CSRF & XSS.pptx
REPORT: Heating appliances market in Poland 2024
AI And Its Effect On The Evolving IT Sector In Australia - Elevate
Chapter 2 Digital Image Fundamentals.pdf
CIFDAQ's Token Spotlight: SKY - A Forgotten Giant's Comeback?
NewMind AI Weekly Chronicles - August'25 Week I
Modernizing your data center with Dell and AMD
Sensors and Actuators in IoT Systems using pdf
ai-archetype-understanding-the-personality-of-agentic-ai.pdf
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
Understanding_Digital_Forensics_Presentation.pptx
GamePlan Trading System Review: Professional Trader's Honest Take
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Top Generative AI Tools for Patent Drafting in 2025.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
HCSP-Presales-Campus Network Planning and Design V1.0 Training Material-Witho...
Ad

BWU_BTA_22_508_cSd how os are implemented.pptx

  • 1. NAME- RANJAN DAS STUDENT CODE- BWU/BTA/22/508 DEPARTMENT- B.TECH CSE(AIML) SEC- I SEM- 4th SUBJECT NAME- OPERATING SYSTEM SUBJECT CODE- PCC-CSM401 TOPIC NAME- SHELL PROGRAMING
  • 2. Contents • Introduction • Type of shells • Shell scripting • Basics of shell scripting • Uses of shell scripting
  • 3. WHAT IS A SHELL A shell is a program that takes commands typed by the user and calls the operating system to run those commands. * A shell is a program that acts as the interface between you and the Linux system, allowing you to enter commands for the operating system to execute. * Shell accepts your instruction or commands in English and translate it into computers native binary language.
  • 4. WHY WE USED SHELLS We can use shell scripts to automate administrative tasks. * Encapsulate complex configuration details. * Get at the full power of the operating system. * The ability to combine commands allows you to create new commands * Adding value to your operating system.
  • 5. Types of shells • Bourne shell • C shell • Korn shell • Bash shell • Tcsh shell
  • 6. Shell Scripting Shell scripting is a way to automate tasks using the command- line shell of an operating system. The shell is a program that interprets commands and acts as an intermediary between the user and the operating system. • It is a series of command stored in a plain text file. • A Shell script is similar to a batch file in MS-DOS but is much more powerful than that.
  • 7. Basics of Shell Scripting: • Shebang Line: Every shell script should begin with a shebang line (#!) followed by the path to the shell interpreter. For example, #!/bin/bash indicates that the script should be executed using the Bash shell. • Comments: Comments start with a # and are ignored by the shell. They are used to add explanations or documentation to the script. • Variables: Variables are used to store data. They can be defined and accessed using the $ symbol. • Ex- NAME="John" echo "Hello, $NAME!"
  • 8. Control structures • Shell scripting supports various control structures like loops and conditionals (if, else, elif, case). Here's an example of an if-else statement. • Ex- if [ "$NAME" == "John" ]; then echo "Hello, John!" else echo "Hello, someone else!" fi # fi used to denote the end of a conditional block.
  • 9. Functions We can define functions to organize our code and reuse it. We can perform various type of operation in a program using functions. Ex- greet() { echo "Hello, $1!" } greet "Alice" o/p- Hello, Alice. Square() { Local num=$1 Local result=$((num * num)) echo "The square of $num is: $result" } Square 5 o/p- The square of 5 is: 25
  • 10. Examples where shell scripting can be used: • Monitoring Linux system • Data backup & create snape shots. • To find out available memory & free memory. • Find out all necessary networks are running out or not.