dot space dot
can someone tell me why do i have to specfic . ./setup.sh (notice the space) ?
wat does the "space" in between the dots mean? Thanks. |
The first '.' is the command 'source' to read and execute commands from the filename given as argument.
The second '.' is the current directory. . ./setup.sh is the same as source ./setup.sh or source setup.sh (if the ./, the current directory, is in the PATH environnement variable). |
lol, i still dont get it, cant we just enter ./setup.sh ? in wat kind of circumstance we need to enter 2 dots?
Thanks. |
With the 'source' or '.' command the script need not be executable.
If you use ./setup.sh the file must be so (eg 'rwxr-xr-x' permissions). |
alright , i got it.
thanks. |
But more importantly:
- If you use the "source" or "." keywork, the script is executed in the current environment, which means that changes to variables (eg: PATH) or other (eg: cd /some/directory/) are still valid. - Else such changes are forgotten when execution is done. Example: Code:
(/home/yves)$ echo $PATH Yves. |
All times are GMT -5. The time now is 10:53 AM. |