HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: relative paths - where am I going?
Operating System - HP-UX
1832867
Members
2965
Online
110048
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2002 04:43 PM
09-11-2002 04:43 PM
Hi,I know I am asking a simple question but I reckon I am missing something basic.
opsys = ux 11.00; machine D390
I am in a directory - dirA. (not root directory)
What is the difference when I run:
.(space).profile
and when I run:
./.profile
In other words which .profile am I using? I have issued the above commands, then the 'which .profile' command - both times the result was:
dirA/.profile
I was under the impression that . .profile would be the root directory .profile file and ./.profile was the dirA .profile file. Am I right, or am I totally confused?
Thanks in advance for your help and patience
Maria.
opsys = ux 11.00; machine D390
I am in a directory - dirA. (not root directory)
What is the difference when I run:
.(space).profile
and when I run:
./.profile
In other words which .profile am I using? I have issued the above commands, then the 'which .profile' command - both times the result was:
dirA/.profile
I was under the impression that . .profile would be the root directory .profile file and ./.profile was the dirA .profile file. Am I right, or am I totally confused?
Thanks in advance for your help and patience
Maria.
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2002 04:49 PM
09-11-2002 04:49 PM
Solution
Both commands will access the same .profile, the one in your current directory.
The difference in the commands is that the '.(space).profile' will SOURCE the profile so that all environment variable, etc., are available from your current shell.
The './.profile' will essentially just execute the .profile in a new shell and then exit, so none of the environment variables are available to your current shell.
If you wanted to source the .profile from the root directory (/) you would have to do a '.(space)/.profile'.
The difference in the commands is that the '.(space).profile' will SOURCE the profile so that all environment variable, etc., are available from your current shell.
The './.profile' will essentially just execute the .profile in a new shell and then exit, so none of the environment variables are available to your current shell.
If you wanted to source the .profile from the root directory (/) you would have to do a '.(space)/.profile'.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2002 05:08 PM
09-11-2002 05:08 PM
Re: relative paths - where am I going?
Thank you heaps, Patrick. You have cleared the fog for me. And your assistance was so clear - excellent. thankyou. Maria.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2002 05:18 AM
09-12-2002 05:18 AM
Re: relative paths - where am I going?
Hi Maria,
A small correction to the good information Patrick provided...
Whether you preceed .profile with .(space) or not, the .profile to be executed will be the first one found in your search path. It will not look for .profile in your current directory unless the current directory is specified in your $PATH environmental variable and another .profile is not found in a directory listed before your current directory in $PATH.
For example:
echo $PATH
/usr/sbin:/usr/bin:/home/darrella:.
cd /home/maria
ls -a
.profile
If I do ".profile", the shell will search for .profile in /usr/sbin, /usr/bin, /home/darrella, and lastly, my current directory (/home/maria in this example. The search will stop when .profile is found in any of these directories. So if /home/darrella/.profile exists, the shell will try to execute it. If it doesn't exist, the shell will continue the search and try to execute /home/maria/.profile.
I say "try to execute" because that depends on file and directory permissions.
Darrell
A small correction to the good information Patrick provided...
Whether you preceed .profile with .(space) or not, the .profile to be executed will be the first one found in your search path. It will not look for .profile in your current directory unless the current directory is specified in your $PATH environmental variable and another .profile is not found in a directory listed before your current directory in $PATH.
For example:
echo $PATH
/usr/sbin:/usr/bin:/home/darrella:.
cd /home/maria
ls -a
.profile
If I do ".profile", the shell will search for .profile in /usr/sbin, /usr/bin, /home/darrella, and lastly, my current directory (/home/maria in this example. The search will stop when .profile is found in any of these directories. So if /home/darrella/.profile exists, the shell will try to execute it. If it doesn't exist, the shell will continue the search and try to execute /home/maria/.profile.
I say "try to execute" because that depends on file and directory permissions.
Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP