What is the Shebang symbol on R1-003 Linux?
This article will explain in detail what the Shebang symbol on R1-003 Linux is like, and the content of the article is of high quality, so the editor will share it for you as a reference. I hope you will have some understanding of the relevant knowledge after reading this article.
The symbol Shebang, which is usually written at the beginning of the first line of a script in a Unix system, indicates the interpreter that executes the script file.
1. If there is no # in the script file! On this line, it defaults to interpreting the script with the current Shell (that is, the $SHELL environment variable) when it executes.
two。 If #! The later interpreter is an executable file, so when the script is executed, it passes the file name and its parameters as parameters to the interpreter for execution.
3. If #! If the specified interpreter does not have executable permission, an error "bad interpreter: Permission denied" will be reported. If #! If the specified interpreter is not an executable file, the specified interpreter is ignored and handed over to the current SHELL to execute the script.
4. If #! If the specified interpreter does not exist, an error "bad interpreter: No such file or directory" will be reported. Note: #! The later interpreter, which needs to write its absolute path (e.g. #! / bin/bash), will not automatically look for the interpreter in $PATH.
5. Of course, if you use commands like "bash test.sh" to execute the script, then #! This line will be ignored, and the interpreter will of course use the bash explicitly specified on the command line.
So much for sharing the Shebang symbol on R1-003 Linux. I hope the above content can be helpful to you and learn more knowledge. If you think the article is good, you can share it for more people to see.