Unix Shell Scripting Tutorial with Examples

By Vijay

By Vijay

I'm Vijay, and I've been working on this blog for the past 20+ years! I’ve been in the IT industry for more than 20 years now. I completed my graduation in B.E. Computer Science from a reputed Pune university and then started my career in…

Learn about our editorial policies.
Updated March 9, 2024

Introduction to Unix Shell Scripting:

In Unix, the Command Shell is the native command interpreter. It provides a command line interface for the users to interact with the operating system.

Unix commands may also be executed non-interactively in the form of a Shell Script. The script is a series of commands that will be run together. 

Unix Shell Scripting

Shell scripts can be used for a variety of tasks from customizing your environments to automating your daily tasks.

List of All Unix Shell Scripting Tutorials:

Unix Video #11:

Unix Shell Scripting Basics

This tutorial will give you an overview of shell programming and provide an understanding of some standard shell programs.  This includes shells such as the Bourne Shell (sh) and the Bourne Again Shell (bash).

Shells read configuration files under multiple circumstances that differ depending on the shell. These files usually contain commands for that particular shell and are executed when loaded; they are usually used to set important variables that are used to find executables, like $PATH, and others that control the behavior and appearance of the shell.

  • The Bourne Shell (sh): This was one of the first shell programs that came with Unix and are also the most widely used one. It was developed by Stephen Bourne.  The ~/.profile file is used as a configuration file for sh. This is also the standard shell used for scripting.
  • The C Shell (csh): The C-Shell was developed by Bill Joy, and modeled on the C programming language. It was intended to improve interactivity with features such as listing the command history and editing commands. The ~/.cshrc and the ~/.login files are used as configuration files by csh.
  • The Bourne Again Shell (bash): The bash shell was developed for the GNU project as a replacement for sh. The basic features of bash are copied from sh, and also adds some of the interactivity features from csh.  he ~/.bashrc and the ~/.profile files are used as configuration files by bash.

Check our upcoming tutorial to know more about Vi Editor!!

PREV Tutorial | NEXT Tutorial

Was this helpful?

Thanks for your feedback!

Leave a Comment