Day-04:Basic Linux Shell Scripting for DevOps Engineers.

Day-04:Basic Linux Shell Scripting for DevOps Engineers.

What is Linux Shell Scripting ?

Linux shell scripting is a way to automate tasks in a Linux operating system by writing scripts in a shell language, such as Bash. Shell scripting can help you save time and increase productivity, and it is used for a wide variety of tasks, such as system administration, software development, and data analysis.

Shell scripting for DevOps

Shell scripting is an essential tool for DevOps engineers, as it allows them to automate various tasks involved in the deployment, management, and maintenance of software applications and infrastructure. This automation reduces the time and effort required to perform these tasks manually, enabling DevOps teams to deliver software applications more quickly and with greater consistency.

What is #/bin/bash?

#!/bin/bash is called a shebang or a hashbang. It's a special notation used at the beginning of shell scripts on Unix-based systems (such as Linux and macOS) to indicate the interpreter that should be used to execute the script.

Can we write #!/bin/sh as well?

Yes, you can use #!/bin/sh as the shebang in a shell script. This notation specifies that the script should be interpreted by the default shell on the system, which may be a Bourne shell variant or another shell that is compatible with the Bourne shell syntax.

Steps required to write a shell script.

Step 1: Use any editor like vi or gedit to write a shell script.

syntax: vi <script_file_name.sh>

Step 2: After writing shell script, set execute permissions for your script.

syntax: chmod <permissions> <script_file_name.sh>

Write a Shell Script which prints I will complete #90DaysOofDevOps challenge.

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

Write an Example of If-else in Shell Scripting by comparing 2 numbers.

Thank you for reading this article!