Shell Scripting

Knowing about shell scripting is a must for any advanced Linux administrator or engineer. In this 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.

Objectives

During this course, you will learn how to complete the following tasks:

  • establish and understand scripting environments
  • identify and set elemental scripting components
  • manipulate the execution of scripts

Pre-requisites

Students attending “Shell Scripting with Bash” course should have a basic understanding of Linux Fundamentals, including the File System Hierarchy standard. Students considering attending this course should know how to access system help. The RHCE course is ideal for preparing students for this course.

Course Outline/Agenda

BASH Basics

Filenames, wildcards, and pathname expansion Common utilities - cat / head & tail / sed / grep / tr / find / sort / cut

I/O Channels - Standard Input / Standard Output / Standard Error / Output redirection

Input/Output Channels Standard Input / Standard Output / Standard Error / Output redirection

Process management - Background jobs & job priorities / Background I/O / Control keys / Using Pipelines

  • Command - Line Editing
  • Leveraging the history

Customizing the BASH Environment

Login and logout script (profile)

Command aliases

Shell variables - Built-in variables / Prompt variables / Search path variables & command hashing

Basic Shell Programming

  • Scripting conventions
  • The shebang
  • Execution permissions
  • Using source for script execution
  • Creating (& removing) shell functions
  • Using positional parameters
  • Changing the Internal Field Separator (IFS)
  • Declaring and using local variables (limited scope)
  • Shell string operators
  • Shell pattern matching
  • Command substitution
  • Returning values from functions
  • Understanding BASH return codes

Flow Control

  • test statement & it`s equivalents
  • test combinational logic
  • file tests
  • string tests
  • numeric tests

Decision making in BASH

  • if/else statements
  • for statement
  • case statement
  • select statement
  • while & until statements

Command-Line Options and Variable Typing

  • getopts to parse arguments
  • shift to iterate through arguments
  • declare to type variables
  • performing shell math
  • working with integer variables

arithmetic shortcuts

  • arithmetic for loops
  • working with shell arrays

Input/Output Command-Line Processing

  • Using labels to store data
  • Using echo & read commands
  • Using printf
  • Reading information from files
  • Using command, builtin & enable

Process Handling

  • Process ID`s & Job numbers
  • Foreground and background processes
  • Signal handling
  • using traps to catch signals

Implementing Simple Menus with select Dialog Boxes with dialog

  • Yes/No Box(yesno)
  • Message Box(msgbox)
  • Input Box(input box)
  • Text Box(text box)
  • Menu Box(menu)
  • Check List Box(checklist)
  • Radio List Box(radiolist)
  • progress Meter Box(gauge)

Graphical Boxes with Zenity

  • Yes/No Box(yesno)
  • Message Box(msgbox)
  • Input Box(input box)
  • Text Box(text box)
  • Menu Box(menu)
  • Check List Box(checklist)
  • Radio List Box(radiolist)


bannar1
Courses Offered
RHCA, RHCSS, RHCE,RHCSA,RHCVA, CCNA,CCNP PHP,Mysql
bannar3