First, make sure that the file type is executable.
There are two ways to set the file as an executable file.
1) directly select "executable" in the file property tag, -- if B uses a graphical interface, this method is the simplest and most direct.
2) run the command chmod + X file. Sh. Add executable attributes to file attributes.
Then, execute the shell script file.
1) double-click File. Sh to run the task directly. -- B. Don't laugh. Advantages of the graphic interface: simple and direct.
2) use the command./file. Sh. -- B seems simpler and more straightforward.
**************************************** **************************************** **
However, the West has not been clear about the problem. In other Linux operating systems, we usually use commands such as SH file. Sh to execute shell scripts. In ubuntu, SH is sometimes not very useful. Some people say that Ubuntu uses dash instead of bash by default.