Advertisement
gusibsd

Untitled

Nov 20th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. exec 3<>/tmp/pipe2
  2. for i in $(seq 1 10); do echo -n "0" > /tmp/pipe2; done
  3. for i in $(seq 1 150); do ( read -u 3 -n 1 x; echo "Process $i, sleeping"; sleep $[ ( $RANDOM % 5 ) + 1 ]; echo -n "0" > /tmp/pipe2 )& done
  4. read -u 3 -n 10 x
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement