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
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
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
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
What if we wanted to call 1 shell scripts or execute 1 Bash shell commands when we were writing 1 C programs?
In fact, the header file contains 1 function system () that calls the shell command or script, and it is convenient to simply pass the
I. Basic Shell syntax1. VariablesBy convention, Shell variables are composed of uppercase letters and underscores (_). There are two types of Shell variables:Environment VariableEnvironment variables can be transmitted from the parent process to the
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
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.