The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
help with .profile ammu Shell Programming and Scripting 1 04-16-2008 01:45 AM
Where can I read about the difference between "..profile" and ".profile" zorrokan UNIX for Dummies Questions & Answers 2 09-05-2007 01:35 AM
Difference between .profile and .~/.profile maneesh mehta SCO 3 12-14-2005 04:35 AM
.profile venkyA UNIX for Dummies Questions & Answers 3 09-07-2004 06:52 PM
why i have local.profile, local.cshrc,local.login instead of .profile, .login ? abidmalik UNIX for Dummies Questions & Answers 5 08-27-2002 01:47 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-03-2002
yls177
Guest
  
 

Posts: n/a
Bits: 0 [Banking]
changed .profile but didnt ./.profile, yet reflected changes

hi , i added ls -F to .profile. and i need to do ./.profile for the effect to take effect BUT i didnt and YET the next day when i came to work and log in, the changes took effect. i am on aix.

please explain..

thanks
  #2 (permalink)  
Old 12-04-2002
TioTony's Avatar
TioTony TioTony is offline Forum Advisor  
Bit Pusher
  
 

Join Date: Oct 2001
Location: Southern California
Posts: 332
If you change your .profile, you have to ./.profile in the same session for the changes to take effect. If you open a new session, this is done automatically for you.
  #3 (permalink)  
Old 12-04-2002
hassan2 hassan2 is offline Forum Advisor  
Registered User
  
 

Join Date: Mar 2002
Location: London, England
Posts: 262
I do . ./.profile and this works. just make sure you do . ./.profile from your .profile directory.
  #4 (permalink)  
Old 12-04-2002
yls177
Guest
  
 

Posts: n/a
Bits: 0 [Banking]
hi, all.... i didnt ./profile.. but it works as well.. after doing a walkthrough, i was guessing along the line that doing a su - someuser will do the .profile?

thanks
  #5 (permalink)  
Old 12-05-2002
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,100
OK, here is the full scoop on what is happening...

When a shell starts up it looks at its name. If it starts with a hyphen, it will act as a "login shell". Mostly this means that it will source some startup files in /etc and the user's home directory. For ksh, $HOME/.profile is a start-up file.

Do:
su
ps -fp $$
Since you just ran "su" your shell will be "sh" or something. Now exit the shell and try:
su - root
ps -fp $$

This time the name of the shell will be "-sh". So when this shell started up, it did indeed source the start-up scripts.

Every time that a shell starts it makes the test and sources the files if needed. When change .profile, you affect any new shell that is later started up with first character of its name set to hyphen. But pre-existing shells will need to manually source .profile.
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 10:19 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0