Logo 
Search:

Unix / Linux / Ubuntu Answers

Ask Question   UnAnswered
Home » Forum » Unix / Linux / Ubuntu       RSS Feeds
  on Dec 07 In Unix / Linux / Ubuntu Category.

  
Question Answered By: Adah Miller   on Dec 07

The difference is this:

Running a script starts a new shell, with a new environment. When the
script is done. that shell exits and any variables that were set in that
shell are gone.

Sourcing a script runs the script in the current shell, thus it shares
the variables with your current shell session, When the script exits,
any variables it set are still set since they were set in your current
environment.

Share: 

 

This Question has 8 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Source a script Or get search suggestion and latest updates.


Tagged: