In my ~/.bashrc I've got some changes, the most important one being the change to $PATH. One of the commands I'm using runs through the compile function, but it fails - bash can't find the binary.

Because I can run the binary just find from the command line, and the path to the binary is added to $PATH in my .bashrc, I think that compile doesn't read my .bashrc and thus can't find the binary it needs to run.

The compile function is called by some library to call some other program from shell, so I'd rather not modify the original code.

How can I make compile run the .bashrc first to fix this problem?

  • If you have not changed the compile command away from make, you could just change it to source ~/.bashrc && make. – icarus Nov 12 '17 at 21:21
  • @icarus see the edit - the compile is called by other library, and not used to call make. – MatthewRock Nov 13 '17 at 0:44
  • How are you invoking emacs? Does M-x getenv PATH show your modified PATH? If the issue is just PATH could you fix it with M-x setenv? Sorry not to be directly answering your question. – icarus Nov 13 '17 at 11:57

Your Answer

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

Browse other questions tagged or ask your own question.