Sponsored Content
Top Forums UNIX for Dummies Questions & Answers changed .profile but didnt ./.profile, yet reflected changes Post 32738 by Perderabo on Thursday 5th of December 2002 10:21:27 AM
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.
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. Post Here to Contact Site Administrators and Moderators

profile name

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

9. 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

10. 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
suspend(1)							   User Commands							suspend(1)

NAME
suspend - shell built-in function to halt the current shell SYNOPSIS
sh suspend csh suspend ksh suspend DESCRIPTION
sh Stops the execution of the current shell (but not if it is the login shell). csh Stop the shell in its tracks, much as if it had been sent a stop signal with ^Z. This is most often used to stop shells started by su. ksh Stops the execution of the current shell (but not if it is the login shell). ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
csh(1), kill(1), ksh(1), sh(1), su(1M), attributes(5) SunOS 5.10 15 Apr 1994 suspend(1)
All times are GMT -4. The time now is 11:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy