Shell Scripting Tutorial


A shell script is a computer program designed to be run by the Unix/Linux shell which could be one of the following:

  • The Bourne Shell
  • The C Shell
  • The Korn Shell
  • The GNU Bourne-Again Shell

A shell is a command-line interpreter and typical operations performed by shell scripts include file manipulation, program execution, and printing text.

Extended Shell Scripts

Shell scripts have several required constructs that tell the shell environment what to do and when to do it. Of course, most scripts are more complex than the above one.

The shell is, after all, a real programming language, complete with variables, control structures, and so forth. No matter how complicated a script gets, it is still just a list of commands executed sequentially.

The following script uses the read command which takes the input from the keyboard and assigns it as the value of the variable PERSON and finally prints it on STDOUT.


# Author : Zara Ali
# Copyright (c)
# Script follows here:

echo "What is your name?"
echo "Hello, $PERSON"

Here is a sample run of the script −

What is your name?
Zara Ali
Hello, Zara Ali

Subsequent part of this tutorial will cover Unix/Linux Shell Scripting in detail.

Useful Video Courses


Fundamentals of Unix and Linux System Administration

129 Lectures 23 hours

Eduonix Learning Solutions


Essentials of Unix Operating System

5 Lectures 4.5 hours

Frahaan Hussain


Unix Command Course for Beginners

35 Lectures 2 hours

Pradeep D


Linux/Unix For DevOps and Developers

41 Lectures 2.5 hours

Musab Zayadneh


Linux, Unix OS Command Line and Shell Scripting Introduction

46 Lectures 4 hours



Unix and Linux Training

6 Lectures 4 hours