Unix Shell Scripting -Introduction to Shell Scripting.

Introduction to Shell Scripting:

Collection of UNIX commands, in every operating system shells are present.

Shell is a bunch of UNIX commands.

We are adding all the required commands in a file.

Every shell file is with the extension of .sh

Basically Bash is a default shell in scripting language.

How to know current shell?

$echo $0

This shell command will return the current shell which is running.

Why to use shell,

  • For to automate daily operations.
  • For to customize the work environments.
  • Automate important system operations like shutting down systems.
  • Perform same operation on many files at a time.

Types of Shell:

  1. Bourne Shell
  2. ‘C’ Shell
  3. KORN Shell

Types of Shell in Brief:

  1. Bourne Shell:

The Bourn Shell is also call as standard shell. It is default shell. Having extension as .sh to it’s file. Bourne shell is created by Stevan Bourne. This shell is prmpt is $ and execution command is ‘sh’.

  • ‘C’ Shell:

This shell is includes many of the syntaxes are like C programming due to that reason this shell is call as ‘C Shell’. This shell was created by Bill Joy at university of California.

The shell prompt is ‘%’ and execution is Csh.

  • KORN Shell:

The KORN shell is developed by David Korn at AT & T Bell Laboratories. This shell becomes one of main Salvos in AT & T’s response to the growing popularity of BSD UNIX.

Responsibilities of Shell:

  • Environment control
  • Interpreted programming language
  • Input output redirection
  • Program execution
  • Pipeline hookup

Shell Variables:

Variable is a data name given to store a value.

Type of Variables:

System define

User Define

Two Types of Shell Script:

  1. Interactive shell script:

While execution of shell script user inputs are required that is known as interactive shell script.

  • Non-Interactive shell script:

While execution of script no need of user interaction or any type of inputs is known as non-interactive shell script.

You may also like...

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Microsoft 365

Subscribe now to keep reading and get access to the full archive.

Continue reading