In Linux executing ./my_script.sh and source my_script.sh are two different ways to run a shell script, but they behave differently…