The difference between bash sh and ./

bash:

        This is the interpreter for the Bash shell. When you run a script using bash script.sh, you are telling the system to use the Bash interpreter to execute the script. This means that all Bash features in the script are available.


sh:

        This is the interpreter for the Bourne shell. When you run a script using sh script.sh, you are telling the system to use the Bourne shell interpreter to execute the script. This may cause some features that are available in Bash but not in the Bourne shell to be unavailable.


./:

        This is how to run a script in the current directory. When you run a script using ./script.sh, you are telling the system to find and execute the script in the current directory. This method requires the script to have execution permissions, and will use the interpreter specified by the shebang (#!) in the header of the script file to execute the script. If no interpreter is specified, the default shell interpreter will be used.

Guess you like

Origin blog.csdn.net/qq_34761779/article/details/131998666