General discussion


command-line utility binary won't run without explicit path

By apotheon ·
Okay, folks, this is a weird one:

I have the xli program installed on this machine. Until a day or two ago, it worked just fine. I think I've updated the version, though, with the package manager (don't recall for sure). Xli itself is a handy utility for quickly opening an image in its own window for viewing.

Here's what happens when I try to run it:
$ xli soapbox0.png
bash: /usr/bin/X11/xli: No such file or directory

Here's what happens when I ask bash where it is:
$ which xli

The /usr/bin directory is in my path, as you can see:
$ echo $PATH

(watch the line-wrap on that one)

Because it's a GUI program, I can't just show output when it actually works, but suffice to say that it works if I do this:
$ /usr/bin/xli

It also works if I do this:
# xli

. . . but I (obviously) don't want to run it as root all the time.

Clearly, this is not a permissions issue (or it wouldn't even work with the full path). It's not a missing $PATH entry. It's not a broken alias (I checked, and I even checked all my bash config files for references to xli or /usr/bin and /usr/bin/X11 other than in the path). It's not a symlink issue. It's not a broken binary. Perhaps the most bizarre thing about it is that the "which" command tells me the right path for it, but trying to run it causes it to check the wrong directory path.

I could use a symlink or an alias to "solve" the problem, but really all that does is treat the symptom. I want to actually know what's wrong.

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

by 3xp3rt In reply to command-line utility bina ...

Try to move xli to /usr/local/bin what is in your path too, and let's see if working...
If there is working, probably it's a path problem, what I see the :usr/bin:/bin part of your path can be the cause. The path /bin move somewhere other place (put it the first element for example)

Collapse -

by apotheon In reply to

Nifty. Posting a comment to my own tech question caused the ability to respond to your answer to appear.

I would have liked to give you a reduced point reward (say, 150 points) for offering what was an honest and logical attempt at helping me diagnose the problem, even if it didn't actually help. Unfortunately, TQ&A won't allow me to reward someone for "nice try" answers that don't actually help solve the problem.

I've agonized over this for a bit, and I figure I'll give you the five hundred. I mean -- what good are these damned points anyway?

Thanks for trying to help, anyway.

Collapse -

by apotheon In reply to command-line utility bina ...

I've discovered the solution to the problem through other means. It turns out that the hash table for the instance of bash I have running is showing an older location for the binary than the current location -- in other words, updating the xli version caused it to move, and because I hadn't restarted bash in the meantime it was still trying to run from the old location. The command "hash -r" refreshes the hash table so that it will work again without restarting the bash instance.

TR seems to be having some kind of bug issue: I can't close the question at present, for some reason. Bear with me, folks.

Collapse -

by apotheon In reply to command-line utility bina ...

This question was closed by the author

Related Discussions

Related Forums