May i know the difference between the execution of the commands:
./example.sh
. /example.sh and
./ example.sh
the last and last but one is having space in between that is the difference please suggest me the answer for this...
May i know the difference between the execution of the commands:
./example.sh
. /example.sh and
./ example.sh
the last and last but one is having space in between that is the difference please suggest me the answer for this...
The first one is correct if example.sh is in the current working directory.
The second one is correct if example.sh is in the root directory which is named /
AND you want to source the script (not run in a subshell) dot space scriptname:
. myscript.sh
is called sourcing a script
The third one is completely wrong in anyway I can think of.
and assuming that the file is executable and has a #! line at the beginning
Hello JIM,
Sorry for delay in response can you tell me what "source the script" means?????
Its answered here - link
Sourcing a script runs the script in the current shell. So, any changes made would be visible/available after its execution in the current shell.