Hi Friends
I have one shell script abc.sh
If I run it ./abc.sh and . abc.sh , then what is the difference..
Thanks
Joy:confused:
Hi Friends
I have one shell script abc.sh
If I run it ./abc.sh and . abc.sh , then what is the difference..
Thanks
Joy:confused:
Very simple, ./abc.sh executes the script in a sub shell and this . abc.sh executes that in current shell ...
Execute the following script and understood it better.
cd /tmp;
pwd;
From any directory if you executed it as ./abc.sh then it will just show as /tmp... ( it will also navigate to that specified dir, but in a sub shell .. so you wont be able to recognize it in your shell )
From any directory if you execute this script . abc.sh it will navigate to that directory in the current shell...
Got it !