Skip to content

Instantly share code, notes, and snippets.

@valentinconan
Last active July 17, 2018 06:47
Show Gist options
  • Save valentinconan/d28776a12fd64d4538122e8fbfda40f5 to your computer and use it in GitHub Desktop.
Save valentinconan/d28776a12fd64d4538122e8fbfda40f5 to your computer and use it in GitHub Desktop.

Revisions

  1. valentinconan revised this gist Jun 23, 2017. No changes.
  2. valentinconan created this gist Jun 23, 2017.
    12 changes: 12 additions & 0 deletions sample.bat
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    :label
    echo start
    timeout 5
    REM replace COMMAND by your command
    for /f "delims=" %%i in ('COMMAND') do set _string=%%i
    rem --- Remove whitespace at left
    for /F "tokens=*" %%s in ("%_string%") do set _trimmed=%%s
    echo off
    echo [%_trimmed%]
    if not %_trimmed% == "healthy" goto label
    echo on
    echo end
    8 changes: 8 additions & 0 deletions sample.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    # sampleBat
    A sample of a bat use

    Example of a "while" use

    Launch a command and get the result to make some processing

    Trim the string result