Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am working on some lab computers (read: no administrative rights) that, if I log in, I need to change the PATH variable as X11 starts. The reason is that I need to change the PATH variable at this time, as opposed to later, is that the Print Screen command seems to "bind" during login (forgive my bad explanation of this).

Currently, I have a .bashrc script as a workaround:

#!/bin/bash
export PATH=/home/username/bin:$PATH

I can make it work by starting a new X, but I was wondering if it is possible to change upon login.

cat /etc/redhat-release tells me my distribution is: Red Hat Enterprise Linux Client release 5.8 (Tikanga)

share|improve this question
add comment

2 Answers

You can change $PATH easily for your user account (thus without admin rights). It depends on what kind of shell you have, to find the shell do: echo $SHELL, most likely you have /bin/bash(that echo $SHELL behaves funny sometimes, if so try ps).

If you shell is bash, you want to modify ~/.bash_profile by adding things like:

export PATH=$PATH:/path/to/something/:/path/to/something/else/

or

export PATH=/path/to/something/:/path/to/something/else/:$PATH

If your shell is not bash, you need to modify other files in your user directory in a slightly different way, e.g. tcsh shell commands for the files you need to modify for tcsh.

If another shell is used (unlikely), just use your favorite search engine to check how to modify $PATH for that shell and do this in the per-user files, ~/.something. You don't need admin rights to modify these files.

share|improve this answer
add comment

add proper export to /etc/X11/Xsession file, or even better create a separate /etc/X11/Xsession.d/my_whatever file with such exports.

share|improve this answer
    
Hi Michal, I'm afraid that I don't have permissions to make changes to that directory. :( Looks like admin. rights are needed. –  user1028435 May 1 '12 at 21:38
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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