System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

To modify the /etc/profile of the RHEL 6.5

Sreer
Valued Contributor

To modify the /etc/profile of the RHEL 6.5

Hello Gurus,

 

I have a RHEL 6 server, and i need to add a path as below in /etc/profile.

 

ORACLE_HOME=/u01/app/oracle/product/11.2.0/client_1/

 

I cant see any options to declare variables/Paths here !!! seems its differ from previous versions of Linux.

 

And I think the new PATHs need to be setted via scripts?

 

[root@sdrlhpprecfap1t profile.d]# ls -l
total 72
-rw-r--r--. 1 root root 1127 Jul 16  2014 colorls.csh
-rw-r--r--. 1 root root 1143 Jul 16  2014 colorls.sh
-rw-r--r--. 1 root root   92 Jun 24  2013 cvs.csh
-rw-r--r--. 1 root root   78 Jun 24  2013 cvs.sh
-----
-rw-r--r--. 1 root root  123 Jun  4  2014 less.csh
-rw-r--r--. 1 root root  121 Jun  4  2014 less.sh
-rw-r--r--. 1 root root  976 Jul 18  2011 qt.csh
-rw-r--r--. 1 root root  912 Jul 18  2011 qt.sh
-rw-r--r--. 1 root root  193 Sep 29  2014 set-bmc-url.sh
-rwxr--r--. 1 root root  598 May 29 09:59 set_environment.sh
-rw-r--r--. 1 root root  169 May 20  2009 which2.sh

 

Could you please guide me how to proceed on it? I need to add the above path? where I will add the new PATh info? I have attached the contents of /etc/profile and files in /etc/profile.d

 

Your help will be much appreciated..

 I

Thanks,

Sree

1 REPLY
Dennis Handly
Acclaimed Contributor

Re: To modify the /etc/profile of the RHEL 6.5

Why change /etc/profile?  Why not let every user change his ~/.profile that needs that ORACLE_HOME.

 

Besides your /etc/profile says:

It's much better to create a custom.sh shell script in /etc/profile.d/ to make custom changes to your environment, as this will prevent the need for merging in future updates.