#!/bin/sh

fcntl=$1

ok=0
fail=0
total=0
for _ in `seq 0 10`
do
  total=$(expr $total + 1)
  $fcntl /tmp/foobar & sleep 1
  $fcntl /tmp/foobar
  if [ "$?" -eq "0" ]
  then
    fail=$(expr $fail + 1)
  else
    ok=$(expr $ok + 1)
  fi
  echo "$fcntl: ok: $ok; fail: $fail"
  wait
done
