OK, I'm not really sure if I got the same problem that TMorgan99 was
having, but it looks similar enough, so I'll comment here:

I'm trying to use ccache and have installed it via `apt-get install ccache'. 
I'd like to use it on a by-invocation basis, rather than default to it either 
system wide or user account wide. From gentoo, I was used to prepend commands 
with
    PATH="/usr/lib/ccache/bin:/opt/bin:${PATH}"
to do this, e.g.
    $> PATH="/usr/lib/ccache/bin:/opt/bin:${PATH}" cmake .
    $> make ## CMake remembers the compiler found at generation time, so you 
don't have to prepend the modified PATH it another time.
(If there's more than one command, just run 
`PATH="/usr/lib/ccache/bin:/opt/bin:${PATH}"' (without another command on the 
same line) once and the new PATH would be active for everything issued from 
that terminal. Other terminals would remain unaffected.)

Since on Ubuntu, /opt/bin doesn't exist and /usr/lib/ccache/bin seems to 
contain all the necessary symlinks, I tried
    $> PATH="/usr/lib/ccache/bin:/opt/bin:${PATH}" which gcc
which returned
    /usr/bin/gcc
(I would have expected /usr/lib/ccache/gcc)

My approach seems to fail on two stages:
    $> PATH="/usr/lib/ccache/bin:${PATH}" echo $PATH
    /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
(exptected: 
/usr/lib/ccache/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games)
    $> PATH="/usr/lib/ccache/bin:${PATH}"
    $> echo $PATH
    
/usr/lib/ccache/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
(as expected, so let's try to build upon that:)
    $> export PATH ## is this needed?
    $> which gcc
    /usr/bin/gcc
:-(

I guess this isn't a real bug, but just different expected behavior of
different Linux distributions. If someone can point out what I'm doing
wrong here, that'd be appreciated. (If I should post a question on
answers.launchpad.net/ubuntu rather than commenting here, please let me
know, too.)

-- 
bash ignoring $PATH?
https://bugs.launchpad.net/bugs/146500
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to