When running a ubuntu shell in Docker, a compiled binary shell script in path does not run, but a shell script on path does?

Viewed 33

Here is the GitHub repo for the question: https://github.com/NathanTPerkins/CoolProgram

The program is designed to test a Docker file that would compile at shell script using the "shc" package and then add the path to the folder containing the binary to the PATH variable.

The problem I am encountering is that there is no output with the binary file.

What happens:

  1. when I use the "which" command, it gives me the correct path to the binary file
  2. when I echo the PATH variable, the path to the directory containing the variable is in it
  3. when I run the shell script like "test.sh", and nothing else, the output shows
  4. when I got into the directory with the binary file and run it like "./test", there is output
  5. when I run the binary like a command, "test", there is no output, no error, nothing it just moves to the next line on the shell

To sum up:

  • root@1129847:/somedir# test -> nothing happens no output
  • root@q0w9e8q:/somedir# test.sh -> shows the output of the shell script
  • echo $PATH -> contains the path to the directory containing the binary file
0 Answers
Related