SlideShare une entreprise Scribd logo
1  sur  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]

Contenu connexe

Tendances

Unix Shell Scripting Basics
Unix Shell Scripting BasicsUnix Shell Scripting Basics
Unix Shell Scripting Basics
Dr.Ravi
 
Unix Basics
Unix BasicsUnix Basics
Unix Basics
Dr.Ravi
 
Unix And C
Unix And CUnix And C
Unix And C
Dr.Ravi
 
Talk Unix Shell Script 1
Talk Unix Shell Script 1Talk Unix Shell Script 1
Talk Unix Shell Script 1
Dr.Ravi
 
Airlover 20030324 1
Airlover 20030324 1Airlover 20030324 1
Airlover 20030324 1
Dr.Ravi
 
COSCUP2012: How to write a bash script like the python?
COSCUP2012: How to write a bash script like the python?COSCUP2012: How to write a bash script like the python?
COSCUP2012: How to write a bash script like the python?
Lloyd Huang
 
Logrotate sh
Logrotate shLogrotate sh
Logrotate sh
Ben Pope
 

Tendances (20)

03 tk2123 - pemrograman shell-2
03   tk2123 - pemrograman shell-203   tk2123 - pemrograman shell-2
03 tk2123 - pemrograman shell-2
 
Module 03 Programming on Linux
Module 03 Programming on LinuxModule 03 Programming on Linux
Module 03 Programming on Linux
 
Unix Shell Scripting Basics
Unix Shell Scripting BasicsUnix Shell Scripting Basics
Unix Shell Scripting Basics
 
OpenGurukul : Language : Shell Scripting
OpenGurukul : Language : Shell ScriptingOpenGurukul : Language : Shell Scripting
OpenGurukul : Language : Shell Scripting
 
Unix Basics
Unix BasicsUnix Basics
Unix Basics
 
Unix And C
Unix And CUnix And C
Unix And C
 
BASH Variables Part 1: Basic Interpolation
BASH Variables Part 1: Basic InterpolationBASH Variables Part 1: Basic Interpolation
BASH Variables Part 1: Basic Interpolation
 
Talk Unix Shell Script 1
Talk Unix Shell Script 1Talk Unix Shell Script 1
Talk Unix Shell Script 1
 
Chap06
Chap06Chap06
Chap06
 
Airlover 20030324 1
Airlover 20030324 1Airlover 20030324 1
Airlover 20030324 1
 
Best training-in-mumbai-shell scripting
Best training-in-mumbai-shell scriptingBest training-in-mumbai-shell scripting
Best training-in-mumbai-shell scripting
 
Unix 1st sem lab programs a - VTU Karnataka
Unix 1st sem lab programs a - VTU KarnatakaUnix 1st sem lab programs a - VTU Karnataka
Unix 1st sem lab programs a - VTU Karnataka
 
Shell Script
Shell ScriptShell Script
Shell Script
 
Unix lab manual
Unix lab manualUnix lab manual
Unix lab manual
 
COSCUP2012: How to write a bash script like the python?
COSCUP2012: How to write a bash script like the python?COSCUP2012: How to write a bash script like the python?
COSCUP2012: How to write a bash script like the python?
 
Logrotate sh
Logrotate shLogrotate sh
Logrotate sh
 
Shell Scripting
Shell ScriptingShell Scripting
Shell Scripting
 
Memory Manglement in Raku
Memory Manglement in RakuMemory Manglement in Raku
Memory Manglement in Raku
 
The $path to knowledge: What little it take to unit-test Perl.
The $path to knowledge: What little it take to unit-test Perl.The $path to knowledge: What little it take to unit-test Perl.
The $path to knowledge: What little it take to unit-test Perl.
 
Scroll pHAT HD に美咲フォント
Scroll pHAT HD に美咲フォントScroll pHAT HD に美咲フォント
Scroll pHAT HD に美咲フォント
 

En vedette

Analysis – Album 3
Analysis – Album 3Analysis – Album 3
Analysis – Album 3
Holly Jukes
 
Andrew Goodwin Music Video Theory
Andrew Goodwin Music Video TheoryAndrew Goodwin Music Video Theory
Andrew Goodwin Music Video Theory
Holly Jukes
 
第一期
第一期第一期
第一期
xbluo
 
Actual products against my products
Actual products against my productsActual products against my products
Actual products against my products
Holly Jukes
 

En vedette (20)

Evaluation
EvaluationEvaluation
Evaluation
 
Camera angles
Camera anglesCamera angles
Camera angles
 
Analysis – Album 3
Analysis – Album 3Analysis – Album 3
Analysis – Album 3
 
Evaluation
EvaluationEvaluation
Evaluation
 
Lesson Seven - Of Mice and Men - Creativity
Lesson Seven  - Of Mice and Men - CreativityLesson Seven  - Of Mice and Men - Creativity
Lesson Seven - Of Mice and Men - Creativity
 
Evaluation
EvaluationEvaluation
Evaluation
 
Evaluation
EvaluationEvaluation
Evaluation
 
Aspen pines powerpoint 2017
Aspen pines powerpoint 2017Aspen pines powerpoint 2017
Aspen pines powerpoint 2017
 
Andrew Goodwin Music Video Theory
Andrew Goodwin Music Video TheoryAndrew Goodwin Music Video Theory
Andrew Goodwin Music Video Theory
 
Legacyallpp 110919132020-phpapp02[1]
Legacyallpp 110919132020-phpapp02[1]Legacyallpp 110919132020-phpapp02[1]
Legacyallpp 110919132020-phpapp02[1]
 
Evaluation
EvaluationEvaluation
Evaluation
 
第一期
第一期第一期
第一期
 
Actual products against my products
Actual products against my productsActual products against my products
Actual products against my products
 
Presentation1
Presentation1Presentation1
Presentation1
 
Evaluation
EvaluationEvaluation
Evaluation
 
Risk assessment
Risk assessmentRisk assessment
Risk assessment
 
Aspen Pines 2015-2016 Powerpoint
Aspen Pines 2015-2016 PowerpointAspen Pines 2015-2016 Powerpoint
Aspen Pines 2015-2016 Powerpoint
 
Survey results
Survey resultsSurvey results
Survey results
 
The Reserve In Ft Mitchell Apartments and Townhomes
The Reserve In Ft Mitchell Apartments and TownhomesThe Reserve In Ft Mitchell Apartments and Townhomes
The Reserve In Ft Mitchell Apartments and Townhomes
 
Stakeholders and sustained outcomes
Stakeholders and sustained outcomesStakeholders and sustained outcomes
Stakeholders and sustained outcomes
 

Similaire à Unix shell scripting basics

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
 
Perl.Hacks.On.Vim Perlchina
Perl.Hacks.On.Vim PerlchinaPerl.Hacks.On.Vim Perlchina
Perl.Hacks.On.Vim Perlchina
guestcf9240
 
2014 database - course 2 - php
2014 database - course 2 - php2014 database - course 2 - php
2014 database - course 2 - php
Hung-yu Lin
 

Similaire à Unix shell scripting basics (20)

Perl Moderno
Perl ModernoPerl Moderno
Perl Moderno
 
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
 
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
 
Perl basics for Pentesters
Perl basics for PentestersPerl basics for Pentesters
Perl basics for Pentesters
 
Git::Hooks
Git::HooksGit::Hooks
Git::Hooks
 
PHP: The easiest language to learn.
PHP: The easiest language to learn.PHP: The easiest language to learn.
PHP: The easiest language to learn.
 
PHP 5 Sucks. PHP 5 Rocks.
PHP 5 Sucks. PHP 5 Rocks.PHP 5 Sucks. PHP 5 Rocks.
PHP 5 Sucks. PHP 5 Rocks.
 
Rush, a shell that will yield to you
Rush, a shell that will yield to youRush, a shell that will yield to you
Rush, a shell that will yield to you
 
Bash Scripting Workshop
Bash Scripting WorkshopBash Scripting Workshop
Bash Scripting Workshop
 
Perl.Hacks.On.Vim Perlchina
Perl.Hacks.On.Vim PerlchinaPerl.Hacks.On.Vim Perlchina
Perl.Hacks.On.Vim Perlchina
 
ReactPHP
ReactPHPReactPHP
ReactPHP
 
2014 database - course 2 - php
2014 database - course 2 - php2014 database - course 2 - php
2014 database - course 2 - php
 

Dernier

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Dernier (20)

04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Unix shell scripting basics

Notes de l'éditeur

  1. First match wins Security