Day 4 : Basic Linux Shell Scripting for DevOps.

Day 4 : Basic Linux Shell Scripting for DevOps.

Shell Scripting in DevOps.

  • Shell scripting is the process of creating computer programs or scripts that are interpreted by a Unix or Linux shell, such as bash or sh.

  • It involves writing commands and instructions in a text file that can be executed by the shell to perform various tasks, such as automating repetitive tasks, manipulating files and directories, and running system commands.

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

  • In practice, #!/bin/bash is often used because it provides more advanced features and is more widely available on modern systems. However, if you want your script to be more portable and compatible with a wider range of Unix or Linux systems, you might consider using #!/bin/sh.

Write a Shell Script that prints I will complete the #90DaysofDevOps challenge

  • file creation and provide permission to read, write and execute.

script

  • Writing files with an extension of .sh and running on the terminal.

script sh

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

script1 sh

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

compare-script2 sh

Was it difficult?

  • I think Shell Scripting is not difficult because it's any other programming language we use which have proper syntax with header files to include and many more.

  • Shell scripting involves writing scripts in a Unix shell language, such as Bash, that can automate tasks, process data, and perform system operations. The syntax of shell scripting can be simple, but it can also become complex as you work with more advanced features and commands.


    Happy Learning :)

Did you find this article valuable?

Support DevOps by becoming a sponsor. Any amount is appreciated!