# #day3  Basic Linux Shell Scripting

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1681587256789/e5840816-03e4-4269-87b6-64bb541c8cc6.png align="center")

**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 which 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 start the terminal.

**What is Linux Shell Scripting?**

A shell script is a computer program designed to be run by the Unix/Linux shell which could be one of the following:

* The Bourne Shell
    
* The C Shell
    
* The Korn Shell
    
* The GNU Bourne-Again Shell
    

A shell is a command-line interpreter and typical operations performed by shell scripts include file manipulation, program execution, and printing text.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1681587302823/11227ab1-1161-4e76-937f-21187c63cb24.png align="center")

**What is** `#!/bin/bash?` **Can we write** `#!/bin/sh` **as well?**

`#!/bin/bash` is known as a **shebang** or **hashbang**, which is a special sequence of characters that specifies the interpreter that should be used to execute a script. In this case, `#!/bin/bash` specifies that the script should be executed using the **Bash shell**.

Also, we can use `#!/bin/sh` as a **shebang**. However, there is a difference between the two. `#!/bin/sh` specifies that the script should be executed using the default shell interpreter, which is usually Bash on most Linux systems. However, it can also be another shell, such as **Dash** or **KornShell**, depending on the system configuration.

On the other hand, `#!/bin/bash` specifically specifies the use of the Bash shell, which may be important if your script relies on Bash-specific features or syntax.

**2 . Write a Shell Script that prints I will complete #90DaysOfDevOpsChallenge.**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1681586176822/db3eb568-acf1-4d7a-881b-05c56a8965d4.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1681586235696/05e83cb9-51d3-4bfe-bc7c-bd5d9e155592.png align="center")

**"A Shell Script to take user input, input from arguments and print the variables":**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1681587016474/6eb1480f-d610-436e-81ee-7bbce7896678.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1681587060212/bc7a21d9-1704-454d-a40b-1c90ca024997.png align="center")

**Usage of If/else in Shell Scripting by comparing 2 numbers:**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1681587575390/e9364650-e364-4b25-a9a2-9abddba822ae.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1681587594236/b183b84e-73f9-4943-81a2-c3c405fe4892.png align="center")
