DBAsupport.com Forums - Powered by vBulletin
Results 1 to 6 of 6

Thread: Unix Command Difference

  1. #1
    Join Date
    Nov 2001
    Posts
    110

    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

  2. #2
    Join Date
    May 2002
    Posts
    2,645
    "dot" references your current working directory (cwd or pwd). "dot dot" references the parent directory of "dot."

  3. #3
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    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?
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

  4. #4
    Join Date
    May 2002
    Posts
    2,645
    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.

  5. #5
    Join Date
    Feb 2004
    Posts
    6

    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.

  6. #6
    Join Date
    Nov 2001
    Posts
    110
    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
  •  


Click Here to Expand Forum to Full Width