| Linux Forum Index » Linux Miscellaneous Topics 2 » $PATH in CentOS bash?... |
|
Page 1 of 1 |
|
| Author |
Message |
| Greg Russell... |
Posted: Sat Oct 31, 2009 6:24 pm |
|
|
|
Guest
|
Where is the system-wide $PATH set in bash with CentOS 5.4, please?
# echo $PATH
/usr/lib/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/
usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
I need to 's|/usr/lib/qt-3.3|/usr/local/Trolltech/Qt-4.5.3|' and can't
find where the initial system-wide $PATH is set.
/etc/bashrc and /etc/profile don't seem to be the place where
/usr/lib/qt-3.3/bin is prepended to the $PATH, nor does ~/.bash_profile
and ~/.bashrc.
The following grep hangs after the output for some reason:
# grep -r 'qt-3.3' /etc/*
grep: /etc/httpd/run/pcscd.comm: No such device or address
grep: /etc/httpd/run/avahi-daemon/socket: No such device or address
grep: /etc/httpd/run/cups/cups.sock: No such device or address
grep: /etc/httpd/run/acpid.socket: No such device or address
grep: /etc/httpd/run/libvirt/libvirt-sock-ro: No such device or address
grep: /etc/httpd/run/libvirt/libvirt-sock: No such device or address
grep: /etc/httpd/run/nscd/socket: No such device or address
grep: /etc/httpd/run/sdp: No such device or address
grep: /etc/httpd/run/audispd_events: No such device or address
grep: /etc/httpd/run/dbus/system_bus_socket: No such device or address
grep: /etc/httpd/run/dovecot/dict-server: No such device or address
grep: /etc/httpd/run/dovecot/auth-worker.3232: No such device or address
grep: /etc/httpd/run/dovecot/login/default: No such device or address |
|
|
| Back to top |
|
|
|
| Bit Twister... |
Posted: Sat Oct 31, 2009 6:24 pm |
|
|
|
Guest
|
On Sat, 31 Oct 2009 20:10:00 -0500, Sam wrote:
Quote:
Generally, the default shell profile executes /etc/profile.d/*.sh. Each *.sh
script would perform the package-specific shell environment set up. So the
final value of PATH comes from multiple individual shell scripts each
modifying PATH, for their own needs.
Even if you modify the profile.d shell script which adds this particular
component to PATH, it's going to be overwritten the next time the qt package
gets updated.
A better approach is to leave the system shell profiles alone, and make the
above modification in your $HOME/.profile
Or place your own script or link to a script in /etc/profile.d/ to do
your own settings. Pick a name so it runs last. Example:
$ ls -1l /etc/profile.d/ | tail -2
-rw-r--r-- 1 root root 300 2009-10-21 12:35 openoffice.org.sh
lrwxrwxrwx 1 root root 22 2009-10-29 21:50 xx_local.sh -> /local/bin/xx_local.sh |
|
|
| Back to top |
|
|
|
| Sam... |
Posted: Sat Oct 31, 2009 7:10 pm |
|
|
|
Guest
|
Greg Russell writes:
Quote: Where is the system-wide $PATH set in bash with CentOS 5.4, please?
There is no single location where PATH gets set.
Generally, the default shell profile executes /etc/profile.d/*.sh. Each *.sh
script would perform the package-specific shell environment set up. So the
final value of PATH comes from multiple individual shell scripts each
modifying PATH, for their own needs.
Quote: # echo $PATH
/usr/lib/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/
usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
I need to 's|/usr/lib/qt-3.3|/usr/local/Trolltech/Qt-4.5.3|' and can't
find where the initial system-wide $PATH is set.
Even if you modify the profile.d shell script which adds this particular
component to PATH, it's going to be overwritten the next time the qt package
gets updated.
A better approach is to leave the system shell profiles alone, and make the
above modification in your $HOME/.profile |
|
|
| Back to top |
|
|
|
| Greg Russell... |
Posted: Sat Oct 31, 2009 9:44 pm |
|
|
|
Guest
|
On Sat, 31 Oct 2009 20:10:00 -0500, Sam wrote:
....
Quote: I need to 's|/usr/lib/qt-3.3|/usr/local/Trolltech/Qt-4.5.3|' and can't
find where the initial system-wide $PATH is set.
Even if you modify the profile.d shell script which adds this particular
component to PATH, it's going to be overwritten the next time the qt
package gets updated.
Thank you, with your advice the problem was solved by editing
/etc/profile.d/qt.sh, which *won't* be overwritten next time the Qt
package gets updated :
#qt_prefix=`/usr/bin/pkg-config --variable=prefix qt-mt`
qt_prefix=/usr/local/Trolltech/Qt-4.5.3
.... |
|
|
| Back to top |
|
|
|
|