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?
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 shell scripting for DevOps?
Shell scripts can be used to automate repetitive tasks such as performing daily backups of your system or installing packages on multiple servers, or monitoring the system periodically such as to check the memory, disk usage and raise alarms if required etc. Instead of typing in the commands one after the other n number of times, write a script to automate a set of instructions to be executed one after the other.
What is #!/bin/bash?
#!/bin/bash is called a shebang line which is used to instruct the operating system to use bash as a command interpreter. It starts with #! at the beginning of the script. The main function of a shell is to execute the commands given by the user. It is the default shell assigned by Linux-based operating systems.
Write a shell script that prints- I will complete #90DaysOofDevOps challenge
script:
O/P:
How to make a script executable if it contains only read and write access?
So, now onwards whenever you want to execute the script just type ./ before the script name
Write a Shell Script to take user input, input from arguments and print the variables.
Script:
o/p:
$ is used to declare a variable in Linux shell scripts.
Write an Example of If else in Shell Scripting by comparing 2 numbers
Using user input
Script:
o/p:
Using argument
Script:
o/p: