2

I'm using a fairly cut down version of Linux, which doesn't have Bash. It does however, have Ash. I'm not sure what exactly the differences are, but it seemed like it might be relevant.

Normally I can execute a binary file by simply entering something like /usr/bin/rx to run the program rx. And in that case, I can.

However, the complement program to rx, called sx, is also on this Linux system, and I'd like to use that as well. When I call rx, it works fine, but when I try to do the same for sx, I get

-/bin/ash: /usr/bin/sx: not found

However, sx is present in /usr/bin/. There is a difference between the two programs, the one that works is a part of busybox, while the other seems to just be an additional program. Doing an ls -l showed the permissions as being:

-rwxr-xr-x

so I don't think the problem is that I need to chmod it. Why can't I run this program?

Kamil Maciorowski
  • 69,815
  • 22
  • 136
  • 202
Zephyr
  • 121
  • 2
  • 1
    Promising lead: *[Why do I get “command not found” when the binary file exists?](https://superuser.com/q/248512/432690)* – Kamil Maciorowski Mar 21 '17 at 19:32
  • That does seem like a good possibility(In fact, considering how sparse this system is, it seems quite likely). However, I don't have 'ldd' or 'file' on my system. Is there an alternative way to get that information? – Zephyr Mar 21 '17 at 19:36
  • @Zephyr Did you read the answer to that Q, or just the Q? – Run CMD Mar 21 '17 at 19:45
  • @ClassStacker the answer to that question linked to another question, the answer of which said "ldd and readelf -l will be able to show the ELF interpreter your executable is requesting." However, I don't seem to have ldd on the system I am having problems with. So my followup question was if there was some other way of determining the dependencies. – Zephyr Mar 21 '17 at 19:49
  • Copy the file in question to a different system that *has* `readelf`, use it there to determine path of interpreter. In a pinch, you could even use `strings`, `hexdump` etc. -- anything that looks vaguely similar to `/lib/ld-linux.so` is probably the interpreter. – dirkt Mar 21 '17 at 20:11
  • @Zephyr Actually, the OP finally found a solution which did not rely on any executables; it's given in his comments to the A. That's what I was referring to. – Run CMD Mar 21 '17 at 20:17
  • @ClassStacker Ok, I see what you were talking about. However, I'm not sure if that applies to me. Trying readelf gave me 'Requesting program interpreter: /lib/arm-linux-gnueabihf/ld-linux.so.3', and I DO seem to have that on my problematic system. – Zephyr Mar 21 '17 at 20:23
  • The probable reason for the *"not found"* message is a missing dependency that the executable requires. The simplest method of listing those dependencies is `strings /usr/bin/sx | less`. Identify the loader (should be the first line of output) and libraries apart from the procedure names and labels. If your system does not nave the `strings` and `less` commands, then maybe it has been pared down too much. – sawdust Mar 22 '17 at 00:43

0 Answers0