hi all ,below is my script any suggetion
Quote:
#!/bin/bash
tmp_fifofile="/tmp/$.fifo"
mkfifo $tmp_fifofile
exec 6<>$tmp_fifofile
rm $tmp_fifofile
thread=1
for ((i=0;i<$thread;i++));do
echo
done >&6 #
#item1
for (( j=0;j<10;j++ ))
do
brr[$j]=`echo $RANDOM`
done
#item2
for (( i=0;i<10;i++ ))
do
read -u6
{
arr[$i]=`echo $RANDOM`
echo >&6
} &
done
wait
exec 6>&- # close f6
#print info
echo "array equal"${arr[1]}
echo "brray equal"${brr[1]}
echo "gerenate array Successful"
#end
|
item1 generate array general way
item2 generate brray by parallel way
so perform result is
[root@doom tbctemp]#sh 2.t
array equal
brray equal8516
gerenate array Successful
give me a helping hand
thanks in advances!