Shell Scripting Online Training

A shell system is a system published for the shell, or control range translator of an OS. The shell is often regarded a simple domain-specific development terminology. Common functions conducted by shell programs consist of computer file adjustment, system performance, and publishing published text. Shell scripting has, to some level, more lately come to be associated with 'batch/cmd file' development in Windows surroundings.

Definition

A shell system is generally an itemized text computer file that contains a series of instructions in series. When the system is run, it carries out all the instructions that are in the computer file. The "shell" in the term represents the command-line customer interface that is used to connect with the Linux system kernel. There are a few different seashells currently in use, with the most common ones being the C shell or csh, the Korn shell or ksh, the Bourne shell or sh, and the Bourne-Again shell or party.

Benefits Online Shell Scripting Training

  • Often, composing a shell system is much faster than composing the comparative system code in other development 'languages'.
  • The many advantages include simple system or computer file selection, release, and entertaining debugging.
  • A shell system can be used to provide sequencing and decision-making linkage around current applications, and for moderately-sized applications the lack of a collection step is an advantage.
  • Interpretive running enables you to create debugging system code into a system and re-run it to identify and fix insects.
  • Non-expert users can use scripting to customize the actions of applications, and shell scripting provides some restricted opportunity for multiprocessing.

Course Details

This 2 day course gives you how to present the writing of UNIX Spend programs using the Korn and Party seashells and to the more innovative features of UNIX such as the set manager and the writing data file handling language.

Although based on the Solaris edition of UNIX running on a PC, the concepts learned may be used to all other editions of UNIX such as a Linux system unix, AIX, HP-UX and SCO.
The course takes the structure of a class, with a mix of session, working illustrations and realistic workouts. Although the content may be specialized, at least 1 day is normally needed to cover the primary components.

Shell Scripting Training Course Content

Introduction

  • Objectives
  • Course Schedule
  • Course Introductions
  • Pre-requisites
  • Bibliography
  • Delegate Responsibilities
  • Course Summary

Review of Basics - optional

  • Files
  • Directories and Processes
  • Displaying Directories - ls
  • Getting Help - man
  • Displaying Files - cat, more
  • Simple Commands
  • Piping - using | symbol
  • Redirection - using > symbol
  • Redirection - using >> symbol
  • Redirecting Input - using < symbol
  • Redirecting Errors
  • Using /dev/null
  • Foreground Jobs
  • Background Jobs - &
  • Stopping Jobs - kill
  • Special Files - . and ..
  • The Command Prompt - PS1
  • Creating Aliases
  • Using Aliases
  • Command history
  • Command Line Edit - using Arrow Keys
  • Command Line Edit - using vi
  • Customising the Shell
  • The Home Directory - HOME
  • The Working Directory - pwd
  • Changing Directories - cd
  • Make Directory - mkdir
  • Remove Directory - rmdir
  • Interactive Copy - cp -i
  • Interactive Move - mv -i
  • Interactive Remove - rm -i
  • Removing Directories - rm -r
  • Wild Cards - File Name Generation
  • Word count - wc
  • Finding Files - find
  • Finding Text in Files - grep, sort, cut, uniq, tr
  • Changing Permissions - chmod

Shell Programming

  • Creating Shell Scripts
  • Testing the Command
  • Creating the Script File
  • Adding Execute Permissions
  • Testing the Script
  • Running the Script - time
  • Running the Script - dot
  • Running the Script - exec
  • Running the Script - ksh
  • Debugging the Script
  • Passing Parameters
  • The read Command
  • Using read in Scripts
  • Choosing the Shell
  • Tidying The Output
  • Suppressing Input - stty

Special Characters and Variables

  • Quotation Marks
  • Quoted Strings - ", '
  • Escape Character - *
  • Quoted Strings - `
  • Using $(...)
  • System Variables - set
  • Other Special Variables
  • User Variables
  • User Variables - unset
  • Variables in Scripts
  • Typeset Command
  • Integer Variables
  • Special Constructs

Creating Menus

  • Conditions - case
  • Creating a Menu
  • Iteration - while, until
  • Holding the Output - sleep
  • Holding the Output - dummy read
  • Ending the Script
  • Ending the Loop
  • Hidden Option - forking a shell
  • Trapping Interrupts - trap
  • More on Interrupts
  • Highlighting Text- tput
  • Positioning the Cursor - backtab b
  • Korn Shell Menu

Selection

  • Conditional Testing
  • Testing File Attributes
  • Testing File Permissions
  • Multiple Tests - Nested ifs
  • Multiple Tests - elsif
  • The NOT Condition
  • Multiple Conditions in One Test
  • Testing Strings
  • Using Square Brackets
  • Avoiding Null Input
  • Testing Numbers
  • More on case
  • Displaying Variables
  • Placing Spaces
  • Testing Commands

Iteration, Looping

  • Computations - let
  • Iteration - while, until
  • Infinite Loop
  • Iteration - for
  • More than 9 Parameters - shift

Sub-scripts and Functions

  • Local and Global Variables
  • Sub-scripts
  • Export Command
  • Exit Status
  • Aliases
  • Functions
  • Useful Functions
  • Return Status
  • Manipulating Functions
  • Functions in Scripts

Advanced Commands

  • Debugging - set
  • Setting - set
  • Merging Files - join
  • Merging Files - paste, basename and dirname
  • Job Control - jobs
  • Regular Expressions
  • Global Regular Expression Printer - grep
  • Expression grep - egrep
  • Fast grep - fgrep
  • Computations - expr
  • Computations – bc, eval Command,
  • Argument Processing
  • getopts Command
  • Using Arrays

Advanced Edit – vi & sed

  • vi - Mapping Key Combinations
  • Mapping Control Keys
  • Using Abbreviations
  • Editing Many Files
  • Regular Expressions
  • Global Insert
  • Here document,
  • Batch Stream Editor
  • Find and Replace
  • sed Example

Text File Processing - awk

  • The awk Programming Tool
  • Pattern Matching
  • Regular Expressions
  • Comparison Patterns
  • Compound Patterns
  • Range Patterns
  • Special Patterns
  • Built-in Functions
  • Troubleshooting awk Scripts
  • Passing Parameters
  • Using Contains
  • printf Function
  • Computations
  • Functions
  • substr
  • length
  • Action Statements
  • Control Flow Statements
  • Arrays
  • Arrays with for Loops
  • awk Examples

Unix Shell Scripting Tutorial