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

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
  • 17,262