...

/

General Recommendations on Functions

General Recommendations on Functions

We must know what we should keep in mind when using functions in Bash.

We'll cover the following...

We considered the functions in Bash. Here are general recommendations on how to use them:

  1. Choose names for your functions carefully. They should explain the purpose of the functions.

  2. Declare only local variables inside functions. Use some naming convention for them. This solves potential conflicts of local and global variable names.

  3. Do not use global variables in ...