We have two files, one is parent file (main.sh) and other is configuration file (config.sh). We have to source this configuration file into our parent file.
Script for config.sh

Script for main.sh

Look at the above snapshot, we’ve included config.sh file with source command.
Note: We can also use ( . config.sh ) command instead of ( source config.sh ) .
Now on running main.sh file, config.sh file is included.

Look at the above snapshot, on running main.sh file, content of config.sh file is imported via source command.
Leave a Reply