What’s the difference between running a script and sourcing it

Looking at the title, it has great chance to be marked as “duplicate”. I have a script (test.sh) that does not take any arguments. I call it in following two ways : bash “test.sh” # BASH_ARGC=() # BASH_ARGV=() bash -c “source test.sh” # BASH_ARGC=([0]=”1″ [1]=”0″) # BASH_ARGV=([0]=”test.sh”) # BASH_EXECUTION_STRING=’source test.sh’ The only differences I found…

Details