What is the difference in different modes of execution of shell script ?

Lets say hello.sh is the sample script to execute

$ sh hello.sh
$ pwd/hello.sh

Above commands creates a new process and execute the script, where as below commands runs with the same process id of the shell ( Does not create another process to execute the shell)

$ . ./hello.sh
$source hello.sh

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.