display a - 1 - b - 2 - c - 3…- z - 26 by creating 2 process and each process run at once with a random sleep of 1 to 5
问题 display a1b2c3...z26 by creating 2 process and each process run seperatley with a random sleep of 1 to 5 is there any way to show off the process 1 has to wait for process 2 respectively p1 will generate abcdef... with sleep $[ ( $RANDOM % 5 ) + 1 ]s p2 will generate 12345..with sleep $[ ( $RANDOM % 5 ) + 1 ]s 回答1: Process 1 ./abc.sh > cd /home/sanjaisambu/Sanjai/a1b2/ for j in {a..z} do > while [ -f './syncfile' ] > do > echo 'process 1 waiting' > sleep 1 > done > touch ./syncfile > echo -n