[kwlug-disc] Sleep until command is finished

Znoteer znoteer at mailbox.org
Thu Jan 6 13:35:19 EST 2022


I'm going to go on a limb here:

On Thu, Jan 06, 2022 at 01:06:13PM -0500, Charles M wrote:
> 
> #!/bin/bash
> sudo smartctl -t short /dev/sda &
> while ps -p $PPID > /dev/null; do sleep 1; done;
> sudo smartctl -l selftest /dev/sda | grep "# 1"
> 
> This seems to hang after smartctl starts the short test. I've waited

I'm guessing an infinite loop on the value of PPID.

-- 
Znoteer
znoteer at mailbox.org




More information about the kwlug-disc mailing list