Linux Shell Scripting

Linux Shell Scripting

In this article, we will learn below Points.

  1. What is Kernel?

  2. What is Shell?

  3. What is Linux Shell Scripting?

  4. Task

    -> What is #!/bin/bash? can we write #!/bin/sh as well?

    -> Write a Shell Script that prints I will complete the #90DaysOofDevOps challenge

Kernel

The kernel is the core of a computer operating system that manages operations like file management, memory management, device management,input-output management, etc of the computer. It works as a bridge between application and data processing that executes on the hardware level.

Shell

The Shell in the Linux operating system provides an interface to interact with the operating system. It is used as a command line Interpreter. Shell has standard input and output as its terminal.

Types of Shell :

  1. Command line shells

    -> Provide textual input as the user interface.

    -> Bourne shell(sh),C shell(csh),Bourne-again shell(bash),cmd.exe

    -> Bourne-again shell is mostly used in Linux.

  1. Graphical Shells

    -> Provide a point-and-click type interfece.

    -> Windows shell, Gnome, KDE

Shell Keywords

Linux Shell scripting

A shell script is a computer program designed to be run by the Linux shell. It is called a shell script because it combines a sequence of commands, that would otherwise have to be typed into the keyboard one at a time, into a single script.

Shell Scripting for DevOps

We all know that today's time industry is working a lot on automation so that it can reduce repetitive tasks and human error and save a lot of time working on other areas. With help of shell scripting a DevOps engineer can ease their work.

some shell scripting languages used by DevOps engineers are- Bash, Puppet, Chef, Powershell, etc

Task

  1. What is #!/bin/bash?can we write #!/bin/sh as well?

*#!bin/bash Is used to instruct the operating system to use bash as a command interpreter. Yes, we can write #!/bin/sh to specify the “sh” shell as the interpreter.

  1. Write a Shell Script that prints I will complete the #90DaysOofDevOps challenge

#!/bin/bash echo "I will complete the #90DaysOofDevOps challenge"