#!/bin/shALTER=1153NAME=aiofor i in $(ps -eo pid,etime,comm | \  awk -v alt=$ALTER -v name=$NAME '$2~/[^0-alt]-/ && $3~/name/{print$1} ');do  echo $idone
How can I use the environment variables inside a regular expression in awk?
shell script;awk;regular expression;environment variables
There is no need to use awk:for pr in $(pgrep $NAME); do     elapse=$(ps -o etime= -p $pr)    [ ${elapse%-*} -gt $ALTER ] && echo $prdoneor according  Stephane Chazelas' commentps -C $NAME -o pid=,etime= | awk '$2 + 0 > a && /-/ {print $1}' a=$ALTER