1

Hi everyone I'm trying to modify the path to open msp430-gcc

When I use whereis msp430-gcc :

msp430-gcc: /usr/bin/msp430-gcc /usr/bin/X11/msp430-gcc /opt/msp430-47/bin/msp430-gcc

And what I want is that the firs option was /opt/msp430-47/bin/msp430-gcc

In my ~/.bashrc file my path is PATH=~/opt/msp430-47/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

I've tried to cp th msp430-gcc doc to the /usr/bin. It changes me the version but then I can't compile anything because the files are in other dir.. tha is /opt/msp430-47.

How can I make to put all in the correct path ?

  • ~/opt would be a directory called opt in your home directory: if you want the toplevel system directory /opt then omit the ~ – steeldriver Sep 21 '15 at 11:30
0
  1. Make your preferred path first:

    PATH=/opt/msp430-47/bin:$PATH
    

    Check it

    echo $PATH
    
  2. Fix permissions

    sudo find /opt/msp430-47 -type d -exec chmod +rx "{}" \;
    sudo chmod -R +rx /opt/msp430-47/bin
    
  • I tried and it doesn't work – Efrem Blazquez Sep 21 '15 at 11:28
  • 1
    PATH=/opt/msp430-47/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games even in /etc/sudoers the secure path is secure_path="/opt/msp430-47/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" – Efrem Blazquez Sep 21 '15 at 11:47
  • @EfremBlazquez, Path setup now ok. Possible you have a permissions problem. Updated my answer – user.dz Sep 21 '15 at 11:51
  • ohhhh I made the Fix permission step... and it works !! Thanks !! can you explain me why if I was working like SU i had problems with permissions.. ??? – Efrem Blazquez Sep 21 '15 at 12:03
  • @EfremBlazquez , With superuser you can read folder/files but you can't execute any command from that bin if they don't have execution bit set. – user.dz Sep 21 '15 at 12:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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