#!/bin/bash
#                       /usr/local/bin/iowaiting
# https://crystalfaeries.net/posix/bin/iowaiting
# celeste:crystalfaery IOWAITING 2017-08-23 16:48:35+00:00
# https://www.commandlinefu.com/commands/view/20526/list-process-in-unkillable-state-d-iowait
# List processes in unkillable state D (iowait)
let   sleep=1
while sleep $sleep
do
	let sleep=$sleep+$sleep	# binary back-off
	waiting="$(ps aux | awk '{if ($8 ~ "D") print $0}')" || alert "iowaiting: ${waiting}"
done


syntax highlighted by Code2HTML, v. 0.9.1