Summary: three methods of executing shell scripts, fork, source and exec, are summarized.
Prerequisites
1. any program we run is a child process generated by the parent process. After the child process is completed, it is returned to the parent
Three different methods (fork, exec, source) fork (/directory/script. sh) fork is the most common, that is, directly using/directory/script in the script. sh to call the script. sh script. run a sub-sh... three different methods (fork, exec, source)
Fork (/directory/script.sh): If the shell contains execution commands, then the subcommand does not affect the parent's commands, and then executes the parent command after the subcommands have finished executing. The children's environment
RPM: The difference between fork, source, and exec in LinuxThe shell commands can be divided into internal commands and external commands. Internal commands are implemented by special file formats. Def, such as cd,ls. While external commands are
Three different methods (fork, exec, source) fork (/directory/script. sh) fork is the most common, that is, directly using/directory/script in the script. sh to call the script. sh script. run a sub-shell script to execute the call. When sub-shell
From: http://mindream.wang.blog.163.com/blog/static/2325122220084624318692/Fork (/directory/script. Sh)Fork is the most common. It uses/directory/script. Sh directly in the script to call the script. Sh script.Run a sub-shell script to execute the
When fork, source, and exec are used to run the script in fork mode, shell (parentprocess) generates a childprocess to execute the script. when childprocess ends, the difference between running scripts of parentpro fork, source and exec is returned.
'), System, and exec in Perl
In Perl, the check mark (''), system, and exec are used to execute the command order. This article will show us how they are used, approached, and differentiated.
I. utilization methods
1. check mark ('')
First of all,
Original link: http://blog.chinaunix.net/uid-22548820-id-3181798.html
Fork (/directory/script.sh): If the shell contains execution commands, the subcommands do not affect the parent's commands. When the subcommand executes and then executes
In linux, fork, source and exec are different. shell commands can be divided into internal commands and external commands. internal commands are in special file format. def implementation, such as cd and ls. external commands are implemented through
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.