0

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 ?

Here_2_learn
  • 147
  • 1
  • 8
  • 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 06:41

1 Answers1

1

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

mtak@frisbee:~$ echo $SHELL
/bin/bash

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.

mtak
  • 16,513
  • 2
  • 52
  • 64