changed .profile but didnt ./.profile, yet reflected changes


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers changed .profile but didnt ./.profile, yet reflected changes
# 1  
Old 12-03-2002
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
yls177
# 2  
Old 12-04-2002
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  
Old 12-04-2002
I do . ./.profile and this works. just make sure you do . ./.profile from your .profile directory.
# 4  
Old 12-04-2002
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
yls177
# 5  
Old 12-05-2002
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.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Profile

how to copy the profile of my user to my user Id in unix (2 Replies)
Discussion started by: ramkumar15
2 Replies

2. UNIX for Dummies Questions & Answers

Help with .profile

Hello All , Hope you are doing good. I have problem need you guys help . i tried to modify my .profile i was using PS1="\$ " printf "\033]0;`hostname`\007" and i have alias ( alias e='exit' )as well now wanna use bash as having good options , and modified as below bash -c... (1 Reply)
Discussion started by: radha254
1 Replies

3. Post Here to Contact Site Administrators and Moderators

profile name

How to chage my profile name? (1 Reply)
Discussion started by: kkalyan
1 Replies

4. Shell Programming and Scripting

.profile

Hi, I have entry in .profile like this : alias GH='. /opt/dba/oraadmin/tools/gh.sh' and gh.sh script has some thing like this : #!/bin/ksh echo "Setting the GRID_HOME env variables" ORACLE_SID=GRID_HOME;export ORACLE_SID ORACLE_HOME=$GRID_HOME;export ORACLE_HOME... (1 Reply)
Discussion started by: talashil
1 Replies

5. Infrastructure Monitoring

trap in etc/profile and user .profile

Hello I really wonder what's trap in etc/profile and in each user .profile. I try to google for it but I think I have no luck. Mostly hit is SNMP traps which I think it is not the same thing. I want to know ... 1. What's a "trap 2 3" means and are there any other value I can set... (4 Replies)
Discussion started by: Smith
4 Replies

6. UNIX for Dummies Questions & Answers

difference between /etc/profile and .profile?

What is the difference between /etc/profile and .profile? (5 Replies)
Discussion started by: gehlnar
5 Replies

7. UNIX for Dummies Questions & Answers

Where can I read about the difference between "..profile" and ".profile"

Hi I know from reading O Riley's Classic Shell Scripting' that the .profile file is " the shells configuration file" but I am unable to find a reference to what "..profile" means. I have searched on the net, Sams Teach Yourself Unix, Unix Visual Quickstart Guide and Linux in a Nutshell. I have... (2 Replies)
Discussion started by: zorrokan
2 Replies

8. SCO

Difference between .profile and .~/.profile

what is the difference between these two lines, if we use it in korn shell script: .profile .~/.profile (3 Replies)
Discussion started by: maneesh mehta
3 Replies

9. UNIX for Advanced & Expert Users

.profile

I installed Red Hat 7.1. I found that .profile is not geting executed for any user. I checked the location of .profile . It is in home directory. What may be the reason. Thank you in advance!!! (3 Replies)
Discussion started by: j1yant
3 Replies

10. UNIX for Dummies Questions & Answers

why i have local.profile, local.cshrc,local.login instead of .profile, .login ?

Hello again ! Thanks for response of my first question. there is my second quesiton why i have local.profile instead of .profile file ? my all files in pwd shoes local. before any file. is anybody can tell me about that ? Thanks Abid Malik (5 Replies)
Discussion started by: abidmalik
5 Replies
Login or Register to Ask a Question