Find the answer to your Linux question:
Results 1 to 4 of 4
Hi guys, I have been wondering for a while, how to change a command you're using: when I type 'which qmake' in my command line. I get: /applications/Trolltech/Qt4/linux/bin/qmake and I ...
  1. #1
    Just Joined!
    Join Date
    Mar 2007
    Posts
    15

    Question on Which

    Hi guys,

    I have been wondering for a while, how to change a command you're using:
    when I type 'which qmake' in my command line. I get:
    /applications/Trolltech/Qt4/linux/bin/qmake
    and I want to use the one from
    /usr/local/Qt4/bin/qmake
    How do I do this? or where is this stuff defined.

    Thanks in advance,

    Ed.

  2. #2
    Linux Guru
    Join Date
    Nov 2007
    Location
    Córdoba (Spain)
    Posts
    1,513
    Wherever you define your PATH.

    Some usual ways are /etc/profile and the ~/.bash* or ~/.profile* files, however, it all depends on your OS, the shell you use and some other things. You will have to look around to see where that path is appended, and erase it, or substitute by the preferred alternative.

  3. #3
    Linux Guru
    Join Date
    Nov 2007
    Location
    Córdoba (Spain)
    Posts
    1,513
    If you need an easier way, I guess you can always add your patch in front of the actual PATH variable, that way it will (or should) take precedence over the rest of the contents of the PATH variable.

    So, you could do something like PATH="/usr/local/Qt4/bin/:$PATH" in your csh rc file(s). I know nothing about csh, but it should work provided that the syntax is correct for csh.

  4. #4
    Linux Engineer Freston's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    1,047
    In addition, you can also create a symlink or an alias pointing to whichever version of the command you want.

    If you put a symlink in /bin it will always be executed before anything else, or you can give it a different name like 'qm' that's easy to type/remember and does what you want.
    Code:
    ln -s /usr/local/Qt4/bin/qmake /usr/local/bin/qm
    Or in your profile/bashrc:
    Code:
    alias qm="/usr/local/Qt4/bin/qmake"
    Can't tell an OS by it's GUI

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...