Hello,
First post so apologies in advance if there is any missing information.
I'm having a problem getting scripts to execute. When I check my path, with echo $PATH, I get the following output, showing that ~/.local/bin is in my path.
/home/petersonflake/.local/bin:/home/petersonflake/.cargo/bin:/home/petersonflake/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/var/lib/snapd/snap/bin:/home/petersonflake/goprojects/bin:/home/petersonflake/src/rtags/bin
There, I have the following script:
Code:
#!/usr/bin/env bash
echo "hello world"
I used chmod +x to make the script executable.
When I run ./test, the script executes. When I run test, no error is output, but nothing happens. However, when I rename test to test.sh, and type test.sh, the script runs as expected. I suspect there is a problem with my shebang, but I don't know how to fix it.
I have tried #!/usr/bin/bash, #!/usr/bin/env sh #!/usr/bin/sh #!/bin/bash #!/bin/env sh and so on.
Has anyone encountered this before? These same steps worked as expected on other distributions.