Problem
rustup-init.sh reports "Please copy the file to a location where you can execute binaries and run ./rustup-init", however when I ls the file (and furthermore, try to execute it), it is indeed executable.
This started happening in the ubuntu:21.04 Docker container with image hash: 1fc773f9e714.
Steps
- docker run --rm -it ubuntu@sha256:2fc51f401cb873bfec33022d065efacbaf868b2e23f4dd76d7230d129258e255 bash
- apt update && apt install curl -y
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
Possible Solution(s)
I added set -x to the downloaded script, and did not see anything obvious, though it does seem fairly evident that the call to test -x "$_file" is incorrectly reporting that the file is not executable: ls -l $_file shows that the file is indeed executable, and I am able to run the file manually. 🤷