Renaming .bash_profile to .profile


 
Thread Tools Search this Thread
Operating Systems Linux Renaming .bash_profile to .profile
# 8  
Old 10-06-2014
As part of the server migration we copied all the files and scripts except the .profile where we created a new .bash_profile file with new PATH and LD_LIBRARY_PATH variables on the Linux server.

Now my question is can i simply rename my .bash_profile to .profile? This is a simple switch considering the amount of work needed to identify and edit all the files and scripts where ever .profile is referenced and change it to .bash_profile.
# 9  
Old 10-06-2014
Since you are using bash, I would say there is nothing more to do: It is pointless to copy your .bashrc on .profile ( since you will not be using sh or ksh...)
# 10  
Old 10-06-2014
Why not use a link or even a hard link?
# 11  
Old 10-06-2014
why not to source .bash_profile from the .profile file? That's just a simple change, although as vbe said i don't see the point in doing this either..
The script extension (.sh vs .ksh) doesn't matter in terms what shell interpeter is be used on a script. What matters is the the 'she-bang' specificication on the FIRST line of the a script. As in:
#!/usr/bin/ksh vs #!/usr/bin/bash.
# 12  
Old 10-06-2014
Bash looks for ~/.bash_profile before ~/.profile and executes the first one it finds.
So the best thing to do in my opinion is:
1) put all definitions in ~/.profile
2) source ~/.profile in ~/.bash_profile
# 13  
Old 10-06-2014
Thanks for your inputs. I think Rudy's approach sounds good to me. Also I will forward cero's approach to my teams and will decide on the next steps.

Thank you.

Sudheer
# 14  
Old 10-07-2014
If you are not looking for a quick solution and discuss a new setup with your teams I'd like to suggest what works best for me:
For each application I have scripts to set up the environment variables, located in the filesystem that belongs to that application. In the user profiles I source the setup-scripts I need for that user.
This makes maintanance a lot simpler (especially when working with clusters).
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

.bash_profile question

Hello everyone, I'm trying to set my .bash_profile to change my primary prompt from this: banbatchtest1v:MCPPRD:~>to this: banbatchtest1v:MCPPRD:/home/rcarvall> Here's what my .bash_profile looks like right now: # .bash_profile # Get the aliases and functions if ; then .... (2 Replies)
Discussion started by: galileo1
2 Replies

2. UNIX for Dummies Questions & Answers

Bash_profile versus bashrc

Hi All Please can you tell , what is the difference between bash_profile and bashrc. How to create them? (8 Replies)
Discussion started by: fretagi
8 Replies

3. UNIX for Dummies Questions & Answers

.bash_profile versus .profile of user in Solaris 10

Hi All I am kind of confused, when to use .bash_profile or .profile I have just created a user on a test server, with: useradd -u 103 -d /fretagi -m -s /bin/bash fretagi but now in its home dir I have: -bash-3.2$ ls -al total 14 drwxr-xr-x 2 fretagi other 512 Dec 5 15:54 .... (5 Replies)
Discussion started by: fretagi
5 Replies

4. Shell Programming and Scripting

Add Variable in .bash_profile

Hi, I wanted to do the following, but the command does not seem to work. Any ideas or suggestions please help. #1. If the particular ENV variable IMPACT_HOME is not there in a file grep -q IMPACT_HOME infile || sed -i 'i IMPACT_HOME=/my/new/path' infile #2. If the ENV variable... (4 Replies)
Discussion started by: dbashyam
4 Replies

5. UNIX for Advanced & Expert Users

bash_profile or .profile

Hi, happy new year. on AIX 6.1 , for user oracle , there are two files : bash_profile and .profile I do not know which one is executed when login ? How to know , More over in both of them we have : in .profile : ORACLE_HOME=/appli/oracle/product/10.2.0/db_1... (5 Replies)
Discussion started by: big123456
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. UNIX for Dummies Questions & Answers

bash_profile does not working

Hi all. when i connect as user megaguru i have a problem my .bash_profile does not working^:( if i do: . ./.bash_profile all enviroment variables are in place. How can i force linux to use .bash_profile before logon process? thanx in advance. (1 Reply)
Discussion started by: smallman
1 Replies

8. Shell Programming and Scripting

question in .bash_profile

We are more users using the oracle account, and people want to include theyr own files in .bash_profile. Like this: while ; do echo -n "LOGNAME is '$LOGNAME' (no sens), who are you? " >/dev/stderr read ln export LOGNAME=$ln done This works well when logging in to... (1 Reply)
Discussion started by: hannem
1 Replies

9. Shell Programming and Scripting

.bash_profile problem

Hi Guys, I modified my .bash_profile script , and tried to change the prompt. Following is the line of code in my .bash_profile script. export PS1=" \W " But I get the output as: \W This appears to be my prompt now. Any idea what should be done.. Thanks! (0 Replies)
Discussion started by: nua7
0 Replies

10. UNIX for Dummies Questions & Answers

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 (4 Replies)
Discussion started by: yls177
4 Replies
Login or Register to Ask a Question