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.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
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
2. UNIX for Advanced & Expert Users
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
3. SCO
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
4. UNIX for Dummies Questions & Answers
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
5. UNIX for Dummies Questions & Answers
What is the difference between /etc/profile and .profile? (5 Replies)
Discussion started by: gehlnar
5 Replies
6. Infrastructure Monitoring
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
7. Shell Programming and Scripting
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
8. Post Here to Contact Site Administrators and Moderators
How to chage my profile name? (1 Reply)
Discussion started by: kkalyan
1 Replies
9. UNIX for Dummies Questions & Answers
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
10. UNIX for Dummies Questions & Answers
how to copy the profile of my user to my user Id in unix (2 Replies)
Discussion started by: ramkumar15
2 Replies