[kwlug-disc] Sleep until command is finished

Chris Frey cdfrey at foursquare.net
Thu Jan 6 20:55:20 EST 2022


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"

An alternate way is to use a tool that operates on tasks, like task-spooler:

   http://kwlug.org/pipermail/kwlug-disc_kwlug.org/2020-February/018968.html

- Chris





More information about the kwlug-disc mailing list