langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 deletions
11
Task/Fork/UNIX-Shell/fork-1.sh
Normal file
11
Task/Fork/UNIX-Shell/fork-1.sh
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
i=0
|
||||
(while test $i -lt 10; do
|
||||
sleep 1
|
||||
echo "Child process"
|
||||
i=`expr $i + 1`
|
||||
done) &
|
||||
while test $i -lt 5; do
|
||||
sleep 2
|
||||
echo "Parent process"
|
||||
i=`expr $i + 1`
|
||||
done
|
||||
5
Task/Fork/UNIX-Shell/fork-2.sh
Normal file
5
Task/Fork/UNIX-Shell/fork-2.sh
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
(for ((i=0;i<10;i++)); do sleep 1; echo "Child process"; done) &
|
||||
for ((i=0;i<5;i++)); do
|
||||
sleep 2
|
||||
echo "Parent process"
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue