Shell to create a child process, run independently, does not affect the normal execution of the parent process

Shell script to create a child process

vi clipro.sh
#!/bin/sh echo "hello word' sleep 5

Code parent

we fpro. sh

# ! / Bin / SH 
Source / root / clipro. SH & # sure to add & background, so that the parent process will execute shell statement after the 
clipid = $!          # Obtain a child process PID
 echo  " wait1 " 
SLEEP  3 
the kill $ clipid     # parent process is finished, the child can be killed by kill

 

Guess you like

Origin www.cnblogs.com/bretzhao/p/11833470.html