這是本文件的舊版!


Test Select All
    ${filePath}    Set Variable    /opt/test.txt
    ${preModifiedTime}    Set Variable    ${EMPTY}
    :FOR    ${index}    In Range    100000
    \    Sleep    1s
    \    @{checkResult}    Run Keyword And Ignore Error    Should Exist    ${filePath}
    \    Continue For Loop If    '@{checkResult}[0]'!='PASS'
    \    ${modifiedTime}    Get Modified Time    ${filePath}
    \    Continue For Loop If    '${modifiedTime}'=='${preModifiedTime}'
    \    ${preModifiedTime}    Set Variable    ${modifiedTime}
    \    ${content}    Get File    ${filePath}
    \    @{lines}    Split To Lines    ${content}
    \    log    command=@{lines}[0]
    \    @{checkResult}    Run Keyword And Ignore Error    Should Be Equal    EXIT    @{lines}[0]
    \    Exit For Loop If    '@{checkResult}[0]'=='PASS'
    \    Run Keyword And Ignore Error    Run Command    @{lines}[0]
 
Run Command
    [Arguments]    ${command}
    @{tokens}    Split String    ${command}    |
    ${keyword}    Set Variable    @{tokens}[0]
    Remove From List    ${tokens}    0
    Run Keyword    ${keyword}    @{tokens}