SlideShare a Scribd company logo
1 of 71
UNIX Shell-Scripting Basics
Agenda ,[object Object],[object Object],[object Object],[object Object]
What is a shell? ,[object Object],▌
What is a shell? ,[object Object]
What is a shell? ,[object Object]
What is a shell? INPUT shell OUTPUT ERROR
What is a shell? ,[object Object],[object Object]
Bourne Shells ,[object Object],[object Object],Steve Bourne
Other Common Shells ,[object Object],[object Object],[object Object]
An aside: What do I mean by /bin ? ,[object Object],[object Object],[object Object]
An aside: What do I mean by /bin ? ,[object Object],[object Object],[object Object],[object Object],[object Object]
What is a Shell Script? ,[object Object],[object Object],[object Object]
What is a Shell Script? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
What is a Shell Script?  A Text File ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
An aside: Redirection ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],0 1 2 INPUT env OUTPUT ERROR
What is a Shell Script?  How To Run ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
What is a Shell Script?  What To Do ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
What is a Shell Script?  Executable ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
What is a Shell Script?  Running it ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Finding the program: PATH ,[object Object],[object Object],[object Object],[object Object]
Variables and the Environment ,[object Object],[object Object],[object Object],[object Object],[object Object]
An aside: Quoting ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Variables and the Environment ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Welcome to Shell Scripting! Shebang! The Environment PATH Input, Output, and Error chmod
How to Learn ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Introduction to  bash
Continuing Lines: ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exit Status ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exit Status:  exit ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Logic: test ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Logic: test ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Logic: test ,[object Object],[object Object],[object Object],[object Object]
An aside:  $(( ))  for Math ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Logic: if ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Logic: if ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Logic: if ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Logic: for ,[object Object],[object Object],[object Object],[object Object]
Logic: for ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Logic: for ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Logic: for ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Logic: C-style for ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Logic: C-style for ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Logic: while ,[object Object],[object Object],[object Object],[object Object]
Logic: while ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Counters ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Reusing Code: “Sourcing” ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Variable Manipulation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object]
Running Programs
Reasons for Running Programs ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Pipes ,[object Object],[object Object],[object Object],INPUT echo OUTPUT ERROR 0 1 2 INPUT wc OUTPUT ERROR 0 1 2 A Pipe!
Email Notification ,[object Object],[object Object],[object Object]
Dates ,[object Object],[object Object],[object Object],[object Object]
FTP the Hard Way ,[object Object],[object Object],[object Object],[object Object]
FTP with  wget ,[object Object],[object Object]
FTP with  curl ,[object Object],[object Object],[object Object]
Searching:  grep ,[object Object],[object Object],[object Object],[object Object],[object Object]
Searching:  find ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Searching:  locate ,[object Object],[object Object],[object Object],[object Object]
Applied Shell Programming
Make Your Life Easier ,[object Object],[object Object],[object Object],[object Object],[object Object]
pushd/popd ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Monitoring processes ,[object Object],[object Object],[object Object],[object Object],[object Object]
“DOS” Mode Files ,[object Object],[object Object],[object Object]
sqlplus ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
sqlplus ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Passing Arguments ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
INB Job Submission Template ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Scheduling Jobs ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
It's Over!
Other Questions? ,[object Object],[object Object],[object Object],[object Object]

More Related Content

What's hot

Linux presentation
Linux presentationLinux presentation
Linux presentation
Nikhil Jain
 

What's hot (20)

Introduction to Git and GitHub Part 1
Introduction to Git and GitHub Part 1Introduction to Git and GitHub Part 1
Introduction to Git and GitHub Part 1
 
Github
GithubGithub
Github
 
Starting with Git & GitHub
Starting with Git & GitHubStarting with Git & GitHub
Starting with Git & GitHub
 
Git and GitHub | Concept about Git and GitHub Process | Git Process overview
Git and GitHub | Concept about Git and GitHub Process | Git Process overviewGit and GitHub | Concept about Git and GitHub Process | Git Process overview
Git and GitHub | Concept about Git and GitHub Process | Git Process overview
 
Git and GitHub for Documentation
Git and GitHub for DocumentationGit and GitHub for Documentation
Git and GitHub for Documentation
 
Github - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: Foundations
 
Launch the First Process in Linux System
Launch the First Process in Linux SystemLaunch the First Process in Linux System
Launch the First Process in Linux System
 
Git in 10 minutes
Git in 10 minutesGit in 10 minutes
Git in 10 minutes
 
Git training v10
Git training v10Git training v10
Git training v10
 
The everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitThe everyday developer's guide to version control with Git
The everyday developer's guide to version control with Git
 
Git - Basic Crash Course
Git - Basic Crash CourseGit - Basic Crash Course
Git - Basic Crash Course
 
Tools kali
Tools kaliTools kali
Tools kali
 
Linux presentation
Linux presentationLinux presentation
Linux presentation
 
Git - An Introduction
Git - An IntroductionGit - An Introduction
Git - An Introduction
 
Git and github 101
Git and github 101Git and github 101
Git and github 101
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
GitHub Basics - Derek Bable
GitHub Basics - Derek BableGitHub Basics - Derek Bable
GitHub Basics - Derek Bable
 
A prentation on github
A prentation on githubA prentation on github
A prentation on github
 
Git real slides
Git real slidesGit real slides
Git real slides
 
Linux booting process - Linux System Administration
Linux booting process - Linux System AdministrationLinux booting process - Linux System Administration
Linux booting process - Linux System Administration
 

Viewers also liked

Unix Shell Scripting
Unix Shell ScriptingUnix Shell Scripting
Unix Shell Scripting
Mustafa Qasim
 
Basic command ppt
Basic command pptBasic command ppt
Basic command ppt
Rohit Kumar
 

Viewers also liked (12)

BMC Control M Advantage
BMC Control M Advantage BMC Control M Advantage
BMC Control M Advantage
 
The Power of Simple: Whats New in BMC Control-M 8
The Power of Simple: Whats New in BMC Control-M 8The Power of Simple: Whats New in BMC Control-M 8
The Power of Simple: Whats New in BMC Control-M 8
 
Unix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell ScriptUnix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell Script
 
Shell Scripting in Linux
Shell Scripting in LinuxShell Scripting in Linux
Shell Scripting in Linux
 
Quick start bash script
Quick start   bash scriptQuick start   bash script
Quick start bash script
 
OpenGurukul : Language : Shell Scripting
OpenGurukul : Language : Shell ScriptingOpenGurukul : Language : Shell Scripting
OpenGurukul : Language : Shell Scripting
 
Intro to Linux Shell Scripting
Intro to Linux Shell ScriptingIntro to Linux Shell Scripting
Intro to Linux Shell Scripting
 
Unix Shell Scripting
Unix Shell ScriptingUnix Shell Scripting
Unix Shell Scripting
 
Basic command ppt
Basic command pptBasic command ppt
Basic command ppt
 
Let us c(by yashwant kanetkar) chapter 2 solution
Let us c(by yashwant kanetkar) chapter 2 solutionLet us c(by yashwant kanetkar) chapter 2 solution
Let us c(by yashwant kanetkar) chapter 2 solution
 
Linux command ppt
Linux command pptLinux command ppt
Linux command ppt
 
Linux ppt
Linux pptLinux ppt
Linux ppt
 

Similar to Unix Shell Scripting Basics

Unix Shell Scripting Basics
Unix Shell Scripting BasicsUnix Shell Scripting Basics
Unix Shell Scripting Basics
Sudharsan S
 
Best training-in-mumbai-shell scripting
Best training-in-mumbai-shell scriptingBest training-in-mumbai-shell scripting
Best training-in-mumbai-shell scripting
vibrantuser
 
2-introduction_to_shell_scripting
2-introduction_to_shell_scripting2-introduction_to_shell_scripting
2-introduction_to_shell_scripting
erbipulkumar
 
Interface de Voz con Rails
Interface de Voz con RailsInterface de Voz con Rails
Interface de Voz con Rails
Svet Ivantchev
 
course slides -- powerpoint
course slides -- powerpointcourse slides -- powerpoint
course slides -- powerpoint
webhostingguy
 
Shell Scripts
Shell ScriptsShell Scripts
Shell Scripts
Dr.Ravi
 

Similar to Unix Shell Scripting Basics (20)

Unix Shell Scripting Basics
Unix Shell Scripting BasicsUnix Shell Scripting Basics
Unix Shell Scripting Basics
 
Raspberry pi Part 25
Raspberry pi Part 25Raspberry pi Part 25
Raspberry pi Part 25
 
Perl Moderno
Perl ModernoPerl Moderno
Perl Moderno
 
Module 03 Programming on Linux
Module 03 Programming on LinuxModule 03 Programming on Linux
Module 03 Programming on Linux
 
NYPHP March 2009 Presentation
NYPHP March 2009 PresentationNYPHP March 2009 Presentation
NYPHP March 2009 Presentation
 
Best training-in-mumbai-shell scripting
Best training-in-mumbai-shell scriptingBest training-in-mumbai-shell scripting
Best training-in-mumbai-shell scripting
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
 
Php mysql ppt
Php mysql pptPhp mysql ppt
Php mysql ppt
 
2-introduction_to_shell_scripting
2-introduction_to_shell_scripting2-introduction_to_shell_scripting
2-introduction_to_shell_scripting
 
Unleash your inner console cowboy
Unleash your inner console cowboyUnleash your inner console cowboy
Unleash your inner console cowboy
 
Living With Legacy Code
Living With Legacy CodeLiving With Legacy Code
Living With Legacy Code
 
03 tk2123 - pemrograman shell-2
03   tk2123 - pemrograman shell-203   tk2123 - pemrograman shell-2
03 tk2123 - pemrograman shell-2
 
Bioinformatica 29-09-2011-p1-introduction
Bioinformatica 29-09-2011-p1-introductionBioinformatica 29-09-2011-p1-introduction
Bioinformatica 29-09-2011-p1-introduction
 
Interface de Voz con Rails
Interface de Voz con RailsInterface de Voz con Rails
Interface de Voz con Rails
 
course slides -- powerpoint
course slides -- powerpointcourse slides -- powerpoint
course slides -- powerpoint
 
Shell Scripts
Shell ScriptsShell Scripts
Shell Scripts
 
Perl basics for Pentesters
Perl basics for PentestersPerl basics for Pentesters
Perl basics for Pentesters
 
Git::Hooks
Git::HooksGit::Hooks
Git::Hooks
 
Best training-in-mumbai-shell scripting
Best training-in-mumbai-shell scriptingBest training-in-mumbai-shell scripting
Best training-in-mumbai-shell scripting
 
PHP: The easiest language to learn.
PHP: The easiest language to learn.PHP: The easiest language to learn.
PHP: The easiest language to learn.
 

More from Dr.Ravi

Excel For The Ceo
Excel For The CeoExcel For The Ceo
Excel For The Ceo
Dr.Ravi
 
Project Specs Pf
Project Specs PfProject Specs Pf
Project Specs Pf
Dr.Ravi
 
Assignments Programming Fundamentals
Assignments Programming FundamentalsAssignments Programming Fundamentals
Assignments Programming Fundamentals
Dr.Ravi
 
Hdd Chssc
Hdd ChsscHdd Chssc
Hdd Chssc
Dr.Ravi
 
Chssc Day3
Chssc Day3Chssc Day3
Chssc Day3
Dr.Ravi
 
Chssc Day1
Chssc Day1Chssc Day1
Chssc Day1
Dr.Ravi
 
Chssc Assignments
Chssc AssignmentsChssc Assignments
Chssc Assignments
Dr.Ravi
 
Chssc Day4
Chssc Day4Chssc Day4
Chssc Day4
Dr.Ravi
 
Chssc Day2
Chssc Day2Chssc Day2
Chssc Day2
Dr.Ravi
 
Talk Unix Shell Script
Talk Unix Shell ScriptTalk Unix Shell Script
Talk Unix Shell Script
Dr.Ravi
 
Airlover 20030324 1
Airlover 20030324 1Airlover 20030324 1
Airlover 20030324 1
Dr.Ravi
 
Unix Basics
Unix BasicsUnix Basics
Unix Basics
Dr.Ravi
 
Unix Lec2
Unix Lec2Unix Lec2
Unix Lec2
Dr.Ravi
 
Unix Book
Unix BookUnix Book
Unix Book
Dr.Ravi
 
Unix Basics 04sp
Unix Basics 04spUnix Basics 04sp
Unix Basics 04sp
Dr.Ravi
 

More from Dr.Ravi (20)

Corporate Overview
Corporate  OverviewCorporate  Overview
Corporate Overview
 
Excel For The Ceo
Excel For The CeoExcel For The Ceo
Excel For The Ceo
 
Project Specs Pf
Project Specs PfProject Specs Pf
Project Specs Pf
 
Pf Day5
Pf Day5Pf Day5
Pf Day5
 
Assignments Programming Fundamentals
Assignments Programming FundamentalsAssignments Programming Fundamentals
Assignments Programming Fundamentals
 
Hdd Chssc
Hdd ChsscHdd Chssc
Hdd Chssc
 
Chssc Day3
Chssc Day3Chssc Day3
Chssc Day3
 
Chssc Day1
Chssc Day1Chssc Day1
Chssc Day1
 
Pf Day3
Pf Day3Pf Day3
Pf Day3
 
Ldd Pf
Ldd PfLdd Pf
Ldd Pf
 
Chssc Assignments
Chssc AssignmentsChssc Assignments
Chssc Assignments
 
Chssc Day4
Chssc Day4Chssc Day4
Chssc Day4
 
Chssc Day2
Chssc Day2Chssc Day2
Chssc Day2
 
Talk Unix Shell Script
Talk Unix Shell ScriptTalk Unix Shell Script
Talk Unix Shell Script
 
Chap06
Chap06Chap06
Chap06
 
Airlover 20030324 1
Airlover 20030324 1Airlover 20030324 1
Airlover 20030324 1
 
Unix Basics
Unix BasicsUnix Basics
Unix Basics
 
Unix Lec2
Unix Lec2Unix Lec2
Unix Lec2
 
Unix Book
Unix BookUnix Book
Unix Book
 
Unix Basics 04sp
Unix Basics 04spUnix Basics 04sp
Unix Basics 04sp
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Recently uploaded (20)

"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 

Unix Shell Scripting Basics