sleep: missing operand
For what is here "sleep" ?
run script in such a way:
./{script_name} N
Where 'N' is the number of seconds what processes will work for. If you want brainflayer to work with one start value only just remove following rows:
while 2>1
do
and also replace last 2 rows
sleep $tosleep
done
with
wait
kill $(pgrep brainflayer | echo $(tr '\n' ' '))