Table of contents
- 👉🏻What is Kernal
- 👉🏻What is Shell
- 👉🏻What is linux Shell Scripting
- 👉🏻What is #!/bin/bash? can we write #!/bin/sh as well?
- 👉🏻Let's see how can we create shell scripts..?
- 👉🏻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
👉🏻What is Kernal
The kernel is a core component of an operating system and serves as the main interface between the computer's physical hardware and the processes running on it.
types 0f Kernal: 1) Microkernels, 2) Monolithic kernels, 3) Hybrid kernels
👉🏻What is Shell
Shell is a UNIX term for the interactive user interface with an operating system. The shell is the layer of programming that understands and executes the commands a user enters.
👉🏻What is linux Shell Scripting
Shell scripting is a text file with a list of commands that instruct an operating system to perform certain tasks. It is called a shell script because it combines a sequence of commands, that would otherwise have to be typed into the keyboard one at a time, into a single script.
👉🏻What is #!/bin/bash?
can we write #!/bin/sh
as well?
The #!/bin/bash
and#!/bin/sh
are both Unix shell scripts but offer different purposes that make them unique. Bash includes many advanced features that are lacking in Bourne shell, such as advanced history management, tab completion, and process substitution. On the other hand, the Bourne shell is faster and more efficient than Bash since it has a smaller code base and fewer features to manage.
👉🏻Let's see how can we create shell scripts..?
Use any editor vim or nano script
Command: vim <filename>
:wq
Run the script
Command: bash <filename>
👉🏻Write a Shell Script which prints
I will complete #90DaysOofDevOps challenge
Command: vi <firstscript.sh>
Command: chmod 777 firstscript.sh
Command: ./firstscript.sh
-
👉🏻Write a Shell Script to take user input, input from arguments and print the variables
As you see, the program picked the value of the variable ‘name’ as Trushid and ‘remark’ as excellent.
This is a simple script. You can develop advanced scripts which contain conditional statements, loops, and functions.