#day3 Basic Linux Shell Scripting
Table of contents
No headings in the article.
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 the user 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 the Unix/Linux shell which could be one of the following:
The Bourne Shell
The C Shell
The Korn Shell
The GNU Bourne-Again Shell
A shell is a command-line interpreter and 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?
#!/bin/bash
is known as a shebang or hashbang, which is a special sequence of characters that specifies the interpreter that should be used to execute a script. In this case, #!/bin/bash
specifies that the script should be executed using the Bash shell.
Also, we can use #!/bin/sh
as a shebang. However, there is a difference between the two. #!/bin/sh
specifies that the script should be executed using the default shell interpreter, which is usually Bash on most Linux systems. However, it can also be another shell, such as Dash or KornShell, depending on the system configuration.
On the other hand, #!/bin/bash
specifically specifies the use of the Bash shell, which may be important if your script relies on Bash-specific features or syntax.
2 . Write a Shell Script that prints I will complete #90DaysOfDevOpsChallenge.
"A Shell Script to take user input, input from arguments and print the variables":
Usage of If/else in Shell Scripting by comparing 2 numbers: