Day 4 Task: Basic Linux Shell Scripting for DevOps Engineers.

Day 4 Task: Basic Linux Shell Scripting for DevOps Engineers.

. What is Kernel?
The central component of an operating system on a computer is a computer program called the kernel, which has total authority over all system functions.

. What is shell?

  • An interface for using operating system functions is provided by a specific user program called a shell. Shell takes user commands that are readable by humans and translates them into a form that the kernel can comprehend. It is an interpreter for command languages that carries out commands that are read from files or keyboards. When a user opens a terminal or logs in, the shell is launched.

  • What is linux shell scripting?

    A computer program created specifically for the Linux shell, a command-line interpreter, is known as a shell script. Scripting languages include the different shell script dialects. Shell scripts are typically used for text printing, program execution, and file manipulation.

  • What is #!/bin/bash can we also write #!/bin/bash?sh as well?

    A shebang line, such as #!/bin/bash, tells the operating system to utilize bash as a command interpreter. The whole path to the interpreter, such as /bin/bash, is followed by a number sign and the exclamation point symbol (#!).It specifies the Bash shell's absolute path, which is /usr/bin/bash. In practically all Unix-based operating systems, here is where the Bash shell is typically found by default.

  • Write a shell scripts which can prints i can complete 90_days_of_devops_challenge.

    \>How to write and execute this script:
    \>Launch a text editor (any text editor on Linux/macOS, or Notepad on Windows).
    \>In the text editor, type the command.
    \>Save the file as devops_challenge.sh or any other extension ending in.sh.
    \>Get a terminal open.
    \>Go to the directory where the script was saved.
    \>Run the following command in the terminal to make the script executable: chmod +x devops_challenge.sh.

  • Enter./devops_challenge.sh into the terminal to launch the script.

    When the script runs, the words "I will complete #90DaysOfDevOps challenge" will appear on the console.

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

    A shell script that outputs the variables after accepting command-line parameters and user input

    Save this script to a file, for instance, input_and_arguments.sh. Make the file executable using:

  • Write an example of If else in Shell Scripting by comparing 2 numbers.

    Save this script to a file, such as compare_numbers.sh. Make the file executable:

    Execute the script and respond with two digits when asked. After comparing the figures, the script will produce the proper result.

    Conclusion :)

    Text-based commands can be used to communicate with the operating system and automate processes with Linux shell scripting. It gives users the ability to effortlessly handle several components of their computer, increase efficiency, and create unique tools.

    Thank you for taking the time to read my blog. We appreciate your interest in the material.

    I hope the material was both informative and useful to you. Enjoy your educational trip and don't hesitate to contact us if you have any more questions!

Thank You for reading this Article.