This article references: Shell Scripting Learning Guide
This article reads as follows: Know the shell directive, but do not know how to complete an automated shell script.
Because when editing this article, the author is also a novice. So, in some theories, there may be errors. If there is an error, you want to indicate (can send email:[email protected]).
This article is updated periodically. Until there is a relatively well-developed version.
One: How to get the system to recognize, as well as some upfront details.
1, how the system recognizes: when the system executes an executable file, it finds that it is not an executable format. The kernel receives an error message: This file is not an executable file. At this point, an attempt is attempted to invoke the Invoke interpreter.
2, how to determine the interpreter: The first line of the file needs to be added: #! Symbol. If you want to use the shell, you can add: #! /usr/sh-f. Other interpreters can also use this method, for example: AWK
3, details.
1) #! This line is not recommended for more than 64 characters. (usually not more than)
2) #! With the absolute path. There may be differences in the location of the interpreter between different systems.
Two: some scripting experience.
Linux Learning Note Shell (ii)--Automation script