Okay, so I'm trying to do something that should be rather simple but for some reason I can't quite seem to make it work. All I simply want to do is add a path to the PATH environment variable in openSuse.

So far, I've edited the following line in /etc/default/su :

PATH=/usr/local/bin:/bin:/usr/bin

with this line :

PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/php/bin:/usr/local/mysql/bin

Basically, all I want to do is have access to php and mysqld regardless of how I log in directly from the command prompt without having to type trailing /usr/local/php/bin/ every time. Am I even editing the right file?

I'm a bit of a Linux newbie and to achieve something as trivial as this is eluding me. Server gods out there, drop be a crumb, please? :-)

link|improve this question

67% accept rate
feedback

2 Answers

up vote 0 down vote accepted

Changing /etc/profile, /etc/csh.login, /etc/csh.cshrc, indeed can be changed. However on Suse, if you notice that these file indicate that you should use /etc/profile.local, /etc/csh.login.local and /etc/csh.chsrc.local to establish local environmental modifications. Making changes in these files should isolate you a little bit better in the event of upgrades to the basic packages which may modify these files.

link|improve this answer
feedback

You're right, you should add it to the path.

Typically server-wide shell environment for bash is in /etc/profile. For (t)csh it is /etc/csh.login.

Rather than setting the PATH system-wide, I'd recommend setting it for your individual user. You would specify the PATH in .bash_profile or .cshrc in your home directory.

If you want recommendations for a different shell, you will need to identify what shell you use. If your situation is a special case, you will need to provide additional details, such as how you are authenticating to what user.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.