# Day 4 task: Shell scripting

What is a shell?

In Linux, the "<mark>shell</mark>" is a command-line interface that lets users interact with the operating system by typing commands. It acts as a bridge between the user and the system, interpreting commands and executing them. Popular shells include Bash, sh, and ksh.

What is Linux shell scripting?

Linux <mark>shell scripting</mark> refers to the creation and execution of scripts written in a shell language within a Linux environment. The shell is a command-line interpreter that allows users to interact with the operating system by typing commands. A shell script is a series of commands written in a scripting language that the shell can execute.

Why should we learn shell scripting?

Learning shell scripting is essential for automating tasks, <mark>customizing environments</mark>, <mark>troubleshooting</mark>, and boosting efficiency in managing Linux systems, making it a valuable skill for <mark>IT professionals</mark>, system administrators, and those involved in DevOps.

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

`#!/bin/bash` is called a <mark>shebang</mark> or <mark>hashbang</mark>. It indicates the path to the interpreter that should be used to execute the script.

<mark>Yes</mark>, you can use `#!/bin/sh` as well, and it would specify the Bourne Shell as the interpreter. The shebang is placed at the beginning of a script and helps the system locate and use the correct shell for interpreting the script.

* Write a Shell Script which prints `I will complete the #90DaysOofDevOps challenge`
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1699632011073/7b2092b8-64cd-42dd-a7bd-e05c65c320f7.png align="center")

* Write a Shell Script to take user input, input from arguments and print the variables.
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1699629944900/3eff4adf-32c9-44f0-b764-3d677ce9e730.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1699629967763/96d71586-1bb4-4cc2-a72e-20189f5c1d72.png align="center")

* Write an Example of If else in Shell Scripting
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1699632460532/8b5248e3-49ec-4d62-9486-c07e0f66f11d.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1699632331930/247a7cb8-6ad0-4c63-86ac-410f602bbc4f.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1699632522535/460e39b0-e47f-4760-b79e-6cc0c75dda66.png align="center")

else

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1699632679757/3307fe42-b3ea-49ef-ae0b-34c786506a28.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1699632704515/18aee2f9-651f-42ed-ae91-80fad503fca2.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1699632718776/0543c3f0-e05f-4190-a88b-f10b684279fd.png align="center")

THANK YOU FOR READING!

[**Do follow me on <mark>LinkedIn </mark> for further blogs.**](https://www.linkedin.com/in/manasa-j-03b633238)

[**linkedin.com/in/manasa-j-03b633238**](http://linkedin.com/in/manasa-j-03b633238)
