-
Unix Command Difference
I donot understand what is the difference between the command in UNIX.
. ./.profile(I guess this is also called sourcing in)
&
./.profile
Thanks
-
"dot" references your current working directory (cwd or pwd). "dot dot" references the parent directory of "dot."
-
Isn't the difference that the space after the first dot means that the parent script inherits the environment variables of the child script, or something? So in the second example any setting of env variables would not be visible in the parent?
-
I thought he was trying to emphasize the ".." part vs "." because Fundamentals of Solaris book (as an example for the SCSA cert) makes a big deal out of relative and absolute path. I never use .profile.
-
difference is space
./xxxxx - it means , run script xxxxx in path ./ (this is actual directory), but, the script is running in their own shell and doesn't affect your shell, only returns exit code. So every variable declaration expire with end of the script.
. ./xxxxx it runs script xxxxx in path ./ (current directory) BUT in your shell, so changes made in the script affect your shell (variable declaration and setting).
When you call ". ./.profile", you set-up environment in your working shell. If you use it without dot-space, script runs, succesfull, but from your point of view does nothing because runs in another shell.
-
Thanks JZK, that is exactly what I was looking for. Appreciate it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|