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

猜你喜欢

转载自www.cnblogs.com/chenfulin5/p/9055278.html