Day 4 : Basic Linux Shell Scripting for DevOps Engineers
Basic Linux Shell Scripting
This is #90DaysofDevops challenge under the guidance of Shubham Londhe sir.
Day 4 TASK

1) What is Shell Scripting?
Shell scripting is a technique in which a programmer writes a series of commands for the shell to execute.
These commands are typically used for automating tasks, such as setting up a development environment, deploying code, or performing system maintenance.
A shell script can be used to automate the process of provisioning and configuring a new server, installing necessary software, and setting up security.
Shell scripting is used to automate repetitive tasks and streamline the development and deployment process. This can include tasks such as setting up and configuring development environments, building and testing code, deploying code to various environments, and monitoring and maintaining systems.
The commands in shell scripting are written in a script file and can be executed by the shell, usually Bash, to perform the desired tasks.
2) What is #!/bin/bash?
The “#!/bin/bash” is called a shebang and it is a special type of comment that is used to specify the interpreter that should be used to execute a script.
When a script is executed, the shell looks at the first line of the script file, and checks for the shebang. If it finds it, the shell uses the interpreter specified after the shebang to execute the script. In this case, the script is executed by /bin/bash, which is a common shell on Linux and Unix systems.
#!/bin/bash is a way to specify that the script should be executed by the Bash shell.
Yes, you can use “#!/bin/sh” instead of “#!/bin/bash” to specify that the script should be executed by the sh shell.
3) Write a Shell Script that prints “I will complete #90DaysofDeVops challenge”

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

5) Write an Example of If else in Shell Scripting by comparing two numbers

If this post was helpful, please do follow and click the clap 👏 button below to show your support 😄
_ Thank you for reading

