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 ...
- 10-14-2008 #1Just 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.
- 10-14-2008 #2Linux 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.
- 10-14-2008 #3Linux 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.
- 10-15-2008 #4
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.
Or in your profile/bashrc:Code:ln -s /usr/local/Qt4/bin/qmake /usr/local/bin/qm
Code:alias qm="/usr/local/Qt4/bin/qmake"
Can't tell an OS by it's GUI


Reply With Quote