#!/bin/bash
# exemple de Mutex
> passwd.txt
mkfifo pipe
for (( i=0 ; i - 20 ; i++ ))
do
    {
	echo -n "${BASHPID} " > pipe
	for m in mot de passe de ${i}
	do
	    echo -n "${m} "
	done
	echo
    } >> passwd.txt&
done
sleep 1
read pids < pipe
rm pipe
wait ${pids}
cat passwd.txt
rm passwd.txt
