While I was referring to usage of SOURCE in linux, I got to know that from here source executes the command in current shell and "./" will execute in new shell.

My question is how do we know in which shell the commands are getting executed ?

  • The confusion arise when I saw the terms current shell and new shell. I am just checking how to check the current and new shell. May be the same query could be posted in different way. – Here_2_learn Apr 13 '17 at 6:41

Most (if not all) shells on Linux provide you with the $SHELL environment variable:

mtak@frisbee:~$ echo $SHELL

It's still a better practice to run with ./ and provide a shell in the script you're running (that's in the first line starting with #!). This way you get more consistent results.

Not the answer you're looking for? Browse other questions tagged or ask your own question.