#!/bin/bash# this script prints 'true' if any ancestor process name is any of $REGEXPSREGEXPS="debci autopkgtest adt"set-e
walk(){pid=$1[!-r/proc/$pid/cmdline]&&exit1name=$(ps-p$pid-ocmd|tail-1)forexpin$REGEXPSdoifgrep-e$exp<<<$name>/dev/null;thenechotrueexitfidoneppid=$(ps-oppid=$pid|tr-d' ')walk$ppid}
walk$$