3

I have had a bit of a problem with some commands lately, not working as intended.
I wanted to fiddle with some Markdown and try it as a substitute for some simple HTML pages, so I looked into some easy to use tools and found pandoc.

I went ahead, installed it, it was succesfull and I opened Terminal.app.
However, I am not able to run my command as normal user:

-bash: pandoc: command not found

If I do a man pandoc I am able to see the manual, so I know it is installed.

But I am able to run it as super user aka root.

If I try sudo pandoc I am able to use the tool,
for example sudo pandoc -s test.mdown -o test.html

What is the reason for this and is it easy to fix? It is working perfectly fine on my laptop, but not on my desktop computer.

My $PATH is /opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/texbin

Thanks in advance, this really grinds my gear.

5
  • what does sudo which pandoc say?
    – parkydr
    Commented Jan 20, 2013 at 14:13
  • /usr/local/bin/pandoc
    – Filuren
    Commented Jan 20, 2013 at 14:17
  • What are the permissions and ownership of pandoc?
    – slhck
    Commented Jan 20, 2013 at 14:32
  • As I understand you, you are able to run the command as root user (using the command sudo pandoc), but not as normal user. What does ls -l /usr/local/bin/pandoc say? Maybe only root has permissions to execute the file? And what happens if you start it as /usr/local/bin/pandoc (with the full path)?
    – erik
    Commented Jan 20, 2013 at 14:38
  • ls: /usr/local/bin/pandoc: Permission denied so it looks like permission problems. If I try to run with full path I get -bash: /usr/local/bin/pandoc: Permission denied
    – Filuren
    Commented Jan 20, 2013 at 14:55

2 Answers 2

1

Make sure that you have +x for /usr/local/bin. You would get a Permission denied error if this were a problem with the executable itself; as is, it appears to be a problem with the directory.

2
  • How do I do this? Just sudo chmod +x /usr/local/bin? EDIT: Looks like it's working now, thanks. Any reason why my permission was changed, I do not recall changing anything?
    – Filuren
    Commented Jan 20, 2013 at 14:55
  • You can check this by running ls -l /usr/local. Assuming root owns that directory, you would have to do sudo chmod a+x /usr/local/bin. Commented Jan 20, 2013 at 14:57
0

pandoc probably can't be found in the PATH for the root user. If you can log in as root, run

env | grep ^PATH

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .