# Day 4 - Basic Linux Shell Scripting for DevOps Engineers

# **➡**What is Kernel?

The kernel is the part of the operating system that helps software and hardware work together.

# **➡**What is Shell?

A shell is a program that helps you use the computer by typing commands. It acts as a middleman between you and the operating system.

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

**Linux shell scripting** means writing a set of commands in a file so the computer can run them one by one.

So it can do tasks automatically without you doing everything by hand.

# **➡Day 4 - Task**

1. ### Explain in your own words and examples, what is Shell Scripting for DevOps.
    
    **Linux shell scripting** means writing a set of commands in a file so the computer can run them one by one. So it can do tasks automatically without you doing everything by hand.
    
2. ### **What is**`#!/bin/bash?`**can we write**`#!/bin/sh`**as well?**
    
    The line `#!/bin/bash` or `#!/bin/sh` at the **very top** of a script is called the **shebang line** (also known as hashbang).
    
    `/bin/bash` means: Use the **bash shell** to run this script. Bash is the most commonly used shell in Linux.
    
    `/bin/sh` means: Use the **default shell** on this system to run the script. This could be **sh, bash, or another shell** depending on the system.
    
3. ### **Write a Shell Script which prints**`I will complete #90DaysOofDevOps challenge`
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1748663015694/af2e7a62-1bb4-4556-9fba-4b2d8ae084c0.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1748662981494/6085202c-5b8d-4d77-9edc-94cc310ae178.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/v1748663092293/350a72ac-f85f-41cd-839c-5abdcc342a47.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1748663116923/4798474b-e07f-4a43-ae12-8e8e6eb070e7.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1748663144267/07a3d9ac-3fb7-4df7-a63b-a9a96b651d63.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1748663171068/20aec4a8-b454-40b4-845d-192ba2f3f377.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/v1748663203755/65dce569-620f-4039-85c6-6704fc6d396c.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1748663220651/7f08c7ab-3bdc-4438-87fb-3979ce16c2fb.png align="center")

Thank you for reading! :)
