Basic Linux Shell Scripting for DevOps Engineers

Basic Linux Shell Scripting for DevOps Engineers

#90DaysOfDevOps

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 users 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 a Linux shell, a command-line interpreter. The various dialects of shell scripts are considered to be scripting languages. Typical operations performed by shell scripts include file manipulation, program execution, and printing text.

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

The first line of the script, Shebang, is #!/bin/bash. Shebang instructs the shell to run it through the bash shell. Shebang is nothing more than an absolute path to the bash interpreter. Sh-bang, hashbang, poundbang, and hash-pling are other names for it. A she-bang is a character sequence in computing that consists of the character's number sign and exclamation mark (#!) at the beginning of a script.

Yes, we can specify the path to the Bourne Shell (sh) interpreter with #!/bin/sh. Another common shell in Unix-based operating systems is the Bourne Shell.

Write a Shell Script that prints "I will complete the #90DaysOfDevOps challenge".

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

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

Thanks for giving your valuable time to read this article. If you want to learn more kindly follow me.

~Prabhakar Yadav