Thread fork stdout (9 answers)
Opened by Gast at 2009-01-15 21:14

Dubu
 2009-01-16 00:26
#118050 #118050
User since
2003-08-04
2145 Artikel
ModeratorIn + EditorIn

user image
Code: (dl )
1
2
3
4
5
6
7
8
$ perl -le '$num=0; if (fork) { while(1) { print "Elter: ", ++$num; sleep 1 } } else { while(1) { print "Kind: ", ++$num; sleep 1 } }'
Elter: 1
Kind: 1
Elter: 2
Kind: 2
Elter: 3
Kind: 3
^C

View full thread fork stdout