# Day 4 - Basic Linux Shell Scripting for DevOps Engineers

## **➡**What is Kernel

The kernel is a computer program that is the core of a computer’s operating system, with complete control over everything in the system.

## **➡**What is Shell

A shell is a special user program that provides an interface for the user to use operating system services. Shell accepts human-readable commands from a user and converts them into something that the kernel can understand. It is a command language interpreter that executes commands read from input devices such as keyboards or from files. The shell gets started when the user logs in or starts the terminal.

## **➡**What is Linux Shell Scripting?

A shell script is a computer program designed to be run by a Linux shell, a command-line interpreter. The various dialects of shell scripts are considered to be scripting languages. Typical operations performed by shell scripts include file manipulation, program execution, and printing text.

# **➡Day 4 - Task**

1. **Explain in your own words and examples, what is Shell Scripting for DevOps.**
    
    The shell is the Linux command line interpreter. It provides an interface between the user and the kernel and executes programs called commands. For example, if a user enters ls then the shell executes the ls command. The shell can also execute other programs such as applications, scripts, and user programs (e.g., written in c or the shell programming language).
    
2. **What is**`#!/bin/bash?`**can we write**`#!/bin/sh`**as well?**
    
    `#!/bin/bash` or `#!/bin/sh` in script file is known as a shebang line or hashbang line. It is used to write on top of the script file.
    
    `#!/bin/bash` : It is used for enabling bash shell as an interpreter to execute the script. In maximum systems by default bash shell is used.
    
    `#!/bin/sh` : It is used for the default shell of the system to execute the script which might be different shells like Bourne, and Korn shells.
    
3. **Write a Shell Script which prints**`I will complete #90DaysOofDevOps challenge`
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1707322108130/e82fde8c-a910-4beb-84dd-fb15e635e517.png align="center")
    
4. **Write a Shell Script to take user input, input from arguments, and print the variables.**
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1707322461079/4dce7339-d370-4859-be13-b845cda05da8.png align="center")
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1707322506524/dfc26e8c-bfbb-4425-a154-ff823ee17900.png align="center")
    
5. **Write an Example of If else in Shell Scripting by comparing 2 numbers**
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1707322885255/b03ed931-5847-4fe1-a891-225ed5cd5792.png align="center")
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1707322927828/9db716b8-aa7f-4f6a-a13f-9c226140da3f.png align="center")
    
    Thank you for reading! :)
