Linux shell while

  • sh

    count=1
    while [ $count -le 5 ];
    do
        echo 1234567890abcdefghqwertyuiopdasdk > /dev/ttyS1 &
        echo 1234567890abcdefghqwertyuiopdasdk > /dev/ttyS3 &
        echo 1234567890abcdefghqwertyuiopdasdk > /dev/ttyS5 &
        echo 1234567890abcdefghqwertyuiopdasdk > /dev/ttyS7 &
        echo 1234567890abcdefghqwertyuiopdasdk > /dev/ttyS9 &
        echo 1234567890abcdefghqwertyuiopdasdk > /dev/ttyS11 &
        echo 1234567890abcdefghqwertyuiopdasdk > /dev/ttyS13 &
        echo 1234567890abcdefghqwertyuiopdasdk > /dev/ttyS15 &
        sleep 1

        let count+=1
        echo $count
    done
posted @ 2018-05-18 11:14  陈富林  阅读(710)  评论(0编辑  收藏  举报