0

I'm not sure if it's a quirk of the program I'm trying to run (amidelnx) or if it's something with the way some binaries in general function. Also, I've read this question but it is not the same as what I'm experiencing.

The binary runs fine when it's "./"ed in a local directory, but if I move it to /usr/bin and attempt to just type it like a regular command it fails with "30 - Error: Problem opening file for reading.".

I can also type an absolute path to it and that works, but not if I just type the command:

/usr/bin/amidelnx               - works
cd /usr/bin;./amidelnx          - works
mv /usr/bin/amidelnx /root; cd /root; ./amidelnx  - works

mv amidelnx /usr/bin; amidelnx  - does NOT work

Any ideas?

5
  • 4
    That message is not from any shell I've ever seen. It probably came from the application itself. Have you contacted its vendor? Jun 18, 2014 at 18:18
  • Not yet, no. The behavior of needing to be in the same directory as it to execute seemed odd and like it would fall within the realm of the OS, but I will be contacting them next.
    – Locane
    Jun 18, 2014 at 18:34
  • Many poorly written applications presumes that the current working directory is the same as the directory where the program is placed, to bad results as they try to open other files that need to be placed in the same directory as the program now can no longer be found.
    – Lie Ryan
    Jun 18, 2014 at 19:28
  • 1
    You can use strace to see what the program is doing or looking for. Jun 18, 2014 at 19:49
  • I wonder if it's getting directory information from argv[0]? It sounds like a badly written program. Jun 20, 2014 at 13:30

2 Answers 2

2

Type which amidelnx. It cached the binary location somewhere else in the path and tries to open it from there.

2

Are you using a csh variant? If so, then placing a program into a directory in your path will not automatically appear until you issue the 'rehash' command. This seems to be the problem you are having.

You must log in to answer this question.

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