Function in every programming language there is a huge impact of it. Let;s see how should we use function in bash or shell script.

Shell or Bash functions are similar to subroutines, procedures, and functions in other programming languages.

Creating Functions

function_name () { 
   list of commands

Call or Invoke a Function


Upon execution, we would receive the following results

Hello World!!
Hello Shihab
Hello Munna
sum: 10
This is From Function 1
This is function 2

Hope this helps.

Thank you