Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

9
  • 12
    @Sony: Note that you should use return to escape from a script sourced in this way, not exit - they are like shell functions, and exit will exit the shell that sourced the script. Commented Dec 19, 2011 at 8:19
  • @CharlesStewart In fact, I'm not familiar with sourced scripts. Thank you! Commented Dec 19, 2011 at 12:56
  • 8
    is source ./script the same? Commented Dec 19, 2011 at 13:04
  • 3
    @amyassin: yes, it is Commented Dec 19, 2011 at 13:05
  • 5
    1. . and source are equal in bash. 2. we don't need to use ./ before filename if it's in the same directory. It is ok to run only this: . script Commented Jun 16, 2016 at 15:02