![]() ![]() It could be bash, perl, python, sh, or something else. If it doesn't, you're not telling the kernel what it is, and therefore the kernel doesn't know what program to use to interprete it. That means every script that is executable should have a hashbang. Then, the script is passed to the program (as second argument) along with all the arguments you gave the script as subsequent arguments. The hashbang tells the kernel what program to run (in this case the command /usr/bin/env is ran with the argument bash). It should contain a hashbang: #! /usr/bin/env bash For non-binaries, this is done by looking at the first line of the file. When a file is executable, the kernel is responsible for figuring out how to execte it. To make a script executable, give it the necessary permission: chmod +x bar To start an executable (which is any file with executable permission) you just specify it by its path: /foo/bar To run a non-executable bash script, use: bash myscript To run a non-executable sh script, use: sh myscript
0 Comments
Leave a Reply. |