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 ?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.
Sign up to join this communityWhile 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 ?
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.