What is Shell Scripting?.

Posted by admin at January 25, 2020

shell - What is Shell Scripting?.

shell script is small computer program that is designed to be run or executed by the Unix shell, which is a command-line interpreter. A shell script is basically a set of commands that the shell in a Unix-based operating system follows.

In effect, a Bash shell script is a computer program written in the Bash programming language. Shell scripting is the art of creating and maintaining such scripts. Shell scripts can be called from the interactive command-line described above; or, they can be called from other parts of the system.

The improvements offered by BASH include:

The Bash syntax is an improved version of the Bourne shell syntax. In most cases Bourne shell scripts can be executed by Bash without any problems.

  • Command line editing.
  • Command line completion.
  • Unlimited size command history.
  • Prompt control.
  • Indexed arrays of unlimited size (Arrays).
  • Integer arithmetic in any base from two to sixty-four.
  • Bash startup files – You can run bash as an interactive login shell, or interactive non-login shell. See Bash Startup files for more information.
  • Bash conditional expressions: Used in composing various expressions for the test builtin or [[ or [ commands.
  • The Directory Stack – History of visited directories.
  • The Restricted Shell: A more controlled mode of shell execution.
  • Bash POSIX Mode: Making Bash behave more closely to what the POSIX standard specifies.

Bash v4.0 Features

  • Usual run time environment: POSIX
  • Command and file name completion – Bash can automatically fill in partially typed commands or arguments to the commands such as file name, hostname and much more.
  • Arithmetic support:
    • Integer Arithmetic supported.
    • Floating point Arithmetic is not supported.
    • Exponential notations is limited via printf build
    • Date and time Arithmetic is not supported.
  • Hash Table: Bash uses a hash table to remember the full pathnames of executable files.
  • Pattern Matching and regular expression are supported.
  • Globbing- For example, you can use *.conf to match all those conf files in /etc directory.
  • Directory Stack is supported via pushd and popd builtins.
  • Command History and History Completion fully supported by Bash.
  • Custom command prompts- Allows you to change the default prompt.

simple Shell Program:

echo welcome to shell Scripting

echo Bash directory is : $BASH
echo Bash version is :$BASH_VERSION
echo Home directory is :$HOME
echo Present working directory :$PWD
echo Ending Script.....


Write a Reply or Comment