Is there a way of turning off progress indication for plink?

20 Views Asked by At

I have a python plink wrapper that essentially calls down to the plink cli via calls that look like:

def plink_wrapper(cmd):
    subprocess.run(
            cmd, capture_output=True, shell=shell, check=check, encoding="utf-8"
    )
    return result.stdout

And my specific call looks something like:

result=plink_wrapper("plink --file input_fileset --make-bed --out output_fileset")

Unfortunately, as part of stdout, plink includes a progress indication, which, when streamed to a file results in a staggering amount of cruft that looks like:

\nScanning .ped file... 0%\b\b1%\b\b2%\b\b3%\b\b4%\b\b5%\b\b6%\b\b7%\b\b8%\b\b9%\b\b10%\b\b\b11%\b\b\b12%\b\b\b13%\b\b\b14%\b\b\b15%\b\b\b16%\b\b\b17%\b\b\b18%\b\b\b19%\b\b\b20%\b\b\b21%\b\b\b22%\b\b\b23%\b\b\b24%\b\b\b25%\b\b\b26%\b\b\b27%\b\b\b28%\b\b\b29%\b\b\b30%\b\b\b31%\b\b\b32%\b\b\b33%\b\b\b34%\b\b\b35%\b\b\b36%\b\b\b37%\b\b\b38%\b\b\b39%\b\b\b40%\b\b\b41%\b\b\b42%\b\b\b43%\b\b\b44%\b\b\b45%\b\b\b46%\b\b\b47%\b\b\

(And this can be arbitrarily long depending on how long the job takes)

Is there an option that plink has to remove this progress indication? I still want the rest of stdout recorded, and regexing out things that look like percentages may run afoul of later output that I want to keep.

I've looked through the plink documentation, especially on the Command Options, Basic Usage and Reference Options sections, but didn't see anything related to progress indication.

0

There are 0 best solutions below