Renaming .bash_profile to .profile

Hi Gurus,

Recently we have migrated our servers from AIX to Linux. Most of the scripts written in AIX server are sourcing environment variables using .profile file. Now we have the following options:

  1. Change all the scripts where ever .profile is being used and replace it with .bash_profile.
  2. Rename .bash_profile to .profile.

Now my question is if I rename the .bash_profile to .profile, what will be the impact on the server or the applications running on that server.

Thanks,
Sudheer

Did you do a 1 to 1 migration?
What AIX version was it?

What is 1 to 1 migration?

We are moving from AIX 6.1 to Linux RHEL 6.5

a 1 to 1 is a migration with all identical : that means having everything on the new box exactly as on the old ( and also should be using same shell...).

6.1... So the default shell was ksh, and you may have some issues since some syntaxes may vary...
Why not just use ksh then?

Thank you.

I noticed that there are some scripts ending with 'sh' and some are with '.ksh'. If we change the profile name from .bash_profile to .profile, will there by any impact on the .sh scripts?

I dont think because if the writer wanted to use /usr/bin/sh rather than the default ksh, he would have put in the script the shell to use on the first line...

Where I dont get you here is why would you want to overwrite the .profile with .bashrc content? Since the AIX used .profile and you copied it to the new system because if you dont change the default shell of your RH system as it is bash it will not read the profile I believe since it finds a .bashrc

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.

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

Why not use a link or even a hard link?

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 .

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

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

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

Thanks Cero. Personally I like to go with your approach. But the advise I got from the teams is to do it the way it is currently setup. Even my manager agrees with them and asked me to follow KISS methodology. When I asked him what is KISS methodology, he says 'Keep It Simple and Stupid' :mad:

I hate to agree with him on this, but there is no other choice for me now.