Xxx.sh two ways to execute scripts

Log on company test mode because there are two kinds, bigwigs directly write a script to complete a key switch, which saw the script file, which appeared send "sh out.sh \ r"; been wondering where sh out .sh mean ... check the information they find is executing the script, but the script is somewhat different ./ execution !!!

First, the use ./ script execution

Prerequisite: requires corresponding .sh file must have execute permissions. The following diagram, the need to execute the file given permission to be performed using ./.

Second, the use sh script execution

Difference: .sh file does not have execute permissions when using sh to execute .sh file can also be performed successfully.

Guess you like

Origin www.cnblogs.com/dnjiang/p/12050437.html