1. Bash script or SH script
2,./script
3,. Script or source script
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/5B/6C/wKiom1UIOtqyKgSsAADRgwmwoFU423.jpg "title=" QQ picture 20150317223121.jpg "alt=" Wkiom1uiotqykgssaadrgwmwofu423.jpg "/>
Description. Or source is a built-in command
The first method is to use the script when it does not have permission to execute
The second method is to execute the script under the current path but must have a row permission
The third method runs under the current process, which is the parent process, while the first two methods create a child process under the parent process to run the script
Give a small example to show the difference:
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/5B/6C/wKiom1UIPMTyk5fLAAFS3Gq_lSA179.jpg "title=" QQ picture 20150317223936.jpg "alt=" Wkiom1uipmtyk5flaafs3gq_lsa179.jpg "/>
Because the first two execution script methods are to create a child process under the current parent process to execute the Shel script, the defined content is not returned to the parent process, and the third method is to execute the script directly under the parent process, which can return the defined content.
Vim/etc/init.d/crond
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/5B/66/wKioL1UIPyPTfsNXAAHBsUIZtKk357.jpg "title=" QQ picture 20150317224454.jpg "alt=" Wkiol1uipyptfsnxaahbsuiztkk357.jpg "/>
We generally use the. Load function library, because the following statement calls a function or variable in the library, and if we use SH, we will not be able to call functions or variables in the library.
This article is from the "Learning Path to Linux" blog, so be sure to keep this source http://2845621599.blog.51cto.com/8221220/1621627
Three ways to execute shell scripts