bash shell scripting - goal technologiesgoaltechnologies.in/shell scripting.pdf · bash shell...

4
BASH Shell Scripting Knowing about shell scripting is a must for any advanced Linux administrator or engineer. In this online course, you will take your first steps towards unleashing the power of shell scripting with BASH through lectures and hands-on labs. Once you have been introduced to shell scripting, you will begin to see the possibilities it can unlock in your own enterprise environment. Duration: 4 Days Training Method: Classroom (hands-on lab) Course References: Base on Linux bash shell (Centos/Ubuntu distro running in VirtualBox) Audience: This intermediate course is for experienced system administrator, programmers, application developers and end users Objective Learn effective methods to create and use Bourne Again Shell (bash) scripts and utilities. Shell scripts are often the key to becoming a productive Unix/Linux system administrator. During this course you will learn to write scripts that demonstrate your ability to write shell scripts in Unix/Linux environment. Note: Basic programming concepts are not taught in this course. Course Outline Day 1 Introduction Shells Types of Unix Shells Uses of Shell Scripts Advantages of Shell Scripts First Shell Script Bash Basics Initialization Files Aliases and Variables Working with Variables Important Internal Bash Variables Command History Input and Output Channels Redirection to Files

Upload: vuongtu

Post on 21-Aug-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: BASH Shell Scripting - GOAL TECHNOLOGIESgoaltechnologies.in/Shell Scripting.pdf · BASH Shell Scripting Knowing about shell scripting is a must for any advanced Linux administrator

BASH Shell Scripting

Knowing about shell scripting is a must for any advanced Linux administrator or

engineer. In this online course, you will take your first steps towards unleashing

the power of shell scripting with BASH through lectures and hands-on labs. Once

you have been introduced to shell scripting, you will begin to see the possibilities it

can unlock in your own enterprise environment.

Duration: 4 Days

Training Method: Classroom (hands-on lab)

Course References: Base on Linux bash shell (Centos/Ubuntu distro running in

VirtualBox)

Audience: This intermediate course is for experienced system administrator,

programmers, application developers and end users

Objective

Learn effective methods to create and use Bourne Again Shell (bash) scripts and

utilities. Shell scripts are often the key to becoming a productive Unix/Linux

system administrator. During this course you will learn to write scripts that

demonstrate your ability to write shell scripts in Unix/Linux environment. Note:

Basic programming concepts are not taught in this course.

Course Outline

Day 1

• Introduction

• Shells

• Types of Unix Shells

• Uses of Shell Scripts

• Advantages of Shell Scripts

• First Shell Script

• Bash Basics

• Initialization Files

• Aliases and Variables

• Working with Variables

• Important Internal Bash Variables

• Command History

• Input and Output Channels

• Redirection to Files

Page 2: BASH Shell Scripting - GOAL TECHNOLOGIESgoaltechnologies.in/Shell Scripting.pdf · BASH Shell Scripting Knowing about shell scripting is a must for any advanced Linux administrator

• The Here Script Operator

• Feeding output to Another Process

• Duplicating the Output with tee

• Types of Commands

• Introduction to Variables

• Variable Substitution

• Variable Assignment

• Special Variable Types / Internal Variables

• Typing Variable

• declare / typeset

• Quoting

• Quoting Variable

• Escaping

• Creating and Using Arrays

• Lab Exercises

Day 2

• Test

• Test Constructs

• File test operators

• Mathematical Comparators

• String Comparators

• Checking Variables

• Other Comparators

• Nested if/then Condition Tests

• Lab Exercices

• Loops and Branches

• Case Statement

• While Loop

• For Loop

• Loop Control

• Breaking Out Current Loop

• Testing and Branching

• Prompting for User Input

• read command

• Using Arguments

• argument variables

Page 3: BASH Shell Scripting - GOAL TECHNOLOGIESgoaltechnologies.in/Shell Scripting.pdf · BASH Shell Scripting Knowing about shell scripting is a must for any advanced Linux administrator

• special argument variables

• using arguments

• Lab Exercises

Day 3

• Strings and substrings

• Searching and Replacing Substrings

• Obscure but Useful String Operations

• simple regular expression matching

• Commands (mastering commands in Unix/Linux in an indispensable prelude to

writing effective shell scripts)

• Internal Commands

• command, echo, printf, read, cd, pwd, pushd, popd, dirs

• let, eval, set, unset, export, typeset, declare, readonly, getopts, exit, exec

• shopt, caller, true

• External Commands

• grep, awk, cat, chmod/chown, clear, cp/mv, cut, date, env

• ln, kill/killall, ls, false/true, umask

• sort, uniq, wc

• Functions

• Simple Function

• Complex Function

• Local Variables

• Recursion in Shell Scripting

• Here Script/Document

• introduction to here script

• using here script

• here script with replaceable parameters

• turning it off

• here script and *SQL

• exercise

Day 4

• Useful Tricks

• Escape Character

• Single Quote

• Double Quotes

Page 4: BASH Shell Scripting - GOAL TECHNOLOGIESgoaltechnologies.in/Shell Scripting.pdf · BASH Shell Scripting Knowing about shell scripting is a must for any advanced Linux administrator

• Back Quote

• Linking Output to Input

• Sending Email

• Scheduling with Cron

• Scheduling One Time Task with At

• Debugging Mode

• Colorizing scripts

• ncurses using Dialog

• Lab Exercise with sample Project/Tasks