title: How to get the progress percentage reached in Cygwin using the pipe viewer
body: <p><code>enter code here</code>I wrote a script to import database from a specified sql file to the specific schema. I use the pipe viewer to see the progress.
  when an error happens the load brakes. so i am trying to create a new function to try the load 3 times in case an error happens.(it works fine)
  sometime an error happens after the load is completed 100% , so i want to ignore the error in this case.
  <strong>Is there a way to know the progress percentage that was reached when the error happened?</strong></p>
  <pre><code>try_Load_date_schema(){
      var=$(date +%Y-%m-%d -d &quot;$1&quot;).sql;
      count=0;    
      echo $var;
      cddumps;
      echo &quot;starting load ${var}&quot; $2; 
    while true; do
        loadSucceeded=1;
        echo &quot;attempt: &quot;$((count+1));
        dropSchema $2;
        createSchema $2;
        pv $var | mysql --defaults-extra-file=~/localhost.mysql.conf -h 127.0.0.1 -u root --default-character-set=utf8 $2 || loadSucceeded=0;
        if((&quot;$loadSucceeded&quot; == 0));then # i need to check the progress percentage here
            echo &quot;Loading failed&quot;
            if ((&quot;$count&quot; == 2));then 
                echo &quot; failed to load db with 3 attempts&quot;
                break;
            else
                echo &quot;try loading again ...&quot;
                ((count++))         
            fi
          else
              echo &quot;load Succeeded&quot;
              break;
          fi
    done
    echo &quot;ending load&quot;; 
  }
  </code></pre>
  <p>I want to consider the case in <a href="https://i.stack.imgur.com/u4v9X.png" rel="nofollow noreferrer">screenshot</a> as done and do not load again</p>