If I do:
(getenv "PATH")
I get a list of colon-separated directories, including:
/Users/michaeln/Library/Haskell/bin
If I look at the exec-path
variable, I see a list including the same directory. If I do:
(shell-command "echo $PATH")
I get a list of colon-separated directories including the same Haskell/bin
directory as above. There is an executable pandoc
in that directory. And yet, if I do:
(shell-command "pandoc")
I get in response:
/bin/bash: pandoc: command not found
What am I doing wrong?
pandoc
is located to yourexec-path
: http://emacswiki.org/emacs/ExecPath – lawlist Apr 08 '15 at 05:46pandoc
frombash
shell prompt? – Saravana Apr 08 '15 at 05:53exec-path
variable...". – Michael Norrish Apr 08 '15 at 05:57M-x shell
and typepandoc --version
, or if I run my usual shell within Terminal.app. – Michael Norrish Apr 08 '15 at 05:58exec-path
is only relevant to binaries Emacs wants to run. In this instance Emacs is running a shell (and the shell is running pandoc), so I believe there's no particular reason in this case for pandoc to be accessible fromexec-path
. – phils Apr 08 '15 at 07:35which pandoc
report from the shell? – phils Apr 08 '15 at 07:38PATH
variable? – wvxvw Apr 08 '15 at 12:09../Haskell/bin
directory to your path? my guess is that it is getting added dynamically for interactive shells, which(shell-command)
is not considered by default. does it work if you set the following:(setq shell-command-switch "-ic")
? – waymondo Apr 08 '15 at 14:06PATH
from the shell where it's run. If, for instance, op hasexport PATH=$PATH:~/Haskell/bin
in his.bashrc
, but runs Emacs from, say, a desktop icon, it may not inherit the proper path. – nanny Apr 08 '15 at 14:11(getenv "PATH")
returns the directory I want. Nonetheless, I think @waymondo is right: theHaskell/bin
directory is added interactively, not for non-interactive shells. – Michael Norrish Apr 10 '15 at 03:34