Vijay Rajanna
Vijay Rajanna

Reputation: 665

Path settings from .bash_profile is not reflected across the system

I have few path settings and alias in .bash_profile, and I am exporting those.

For eg: alias gcc=/abc/def/......./myrtgcc export gcc

And I want use myrtgcc to compile c programs either from terminal or from eclipse using the command "GCC", and I expect the system to use "myrtgcc" whenever I compile the programs using

myrtgcc somfile.c -o output

However this is not the case. even after adding the above alias in .bash_profile, and restarting the system ( or use > source .bash_profile ) the changes are not reflected.

because, If I open the terminal and type

which gcc

I get /usr/bin/gcc and when eclipse uses "GCC" command it again invokes the same /usr/bin/gcc.

How do I make myrtgcc default across the system, for command gcc Thank you.

Upvotes: 0

Views: 352

Answers (1)

felixc
felixc

Reputation: 168

  1. Make a symbol link in /abc/def/xxx/myrtgcc

    ln -s myrtgcc gcc

  2. Put the path of myrtgcc in front of /usr/bin in your .bash_profile:

    export PATH=/abc/def/xxx/myrtgcc:$PATH

Upvotes: 1

Related Questions