Bash Scripting

Module-12-How to use trap statement in bash scripts

Table of contents Introduction Bash scripts have a special feature  called trap to execute a code block based on the signals received. Processes in linux machines can receive variety of signals like SIGINT , SIGTERM , SIGQUIT, SIGSEGV , etc  To  view different possible Signals sent to a process with their code number ,  we …

Module-12-How to use trap statement in bash scripts Read More »

Module-11 How to debug bash script using set   -x option

Table of contents Introduction It is very important to understand how to debug a script. While coding new features we might hit some bugs in the code. To debug the issues bash provides some inbuilt features like “set -x” to print the lines of the execution of the code with substitution of the variables along …

Module-11 How to debug bash script using set   -x option Read More »

Module-10-How to create and use complex functions in bash scripting

Table of contents Introduction In our earlier article on simple functions in bash scripting we discussed the different ways we can create a function in your scripts . This Article is the continuation of if , which explores some complex bash functions with different feature sets like passing arguments , using redirection , using return …

Module-10-How to create and use complex functions in bash scripting Read More »

Module-9-How to create and use  functions in bash scripting

Table of contents Introduction We can create functions to avoid writing repetitive lines of codes just like other scripting languages in Bash , but the functionalities available is less when compared to python Syntax to create function in Bash  Following are the different possible syntax we can use to  create a function and call it …

Module-9-How to create and use  functions in bash scripting Read More »

Module-7 How to use Case statement in bash scripting

Table of contents Introduction Case statement : Case statement can be used in place to avoid writing complex nested if conditionals if we have many different conditional checks. Using case statement we can select a section of the code to execute after matching a pattern from the user inputs or other variable  In this article …

Module-7 How to use Case statement in bash scripting Read More »

Module-4- How to use Conditionals in Bash scripting

Table of contents Introduction Conditionals for the Strings in bash scripting Single square bracket Syntax in bash conditionals for Strings Checking whether the string is a empty string using conditionals Double Square bracket syntax in bash conditionals for Strings Conditionals for Integers Square bracket Syntax for Integers in bash conditionals Double parenthesis syntax for the Arithmetic …

Module-4- How to use Conditionals in Bash scripting Read More »