# cat > check_process_is_end.sh
while true
do
sleep 30
res=`ps -ef | grep RNAhybrid`
count=`grep -o "RNAhybrid" <<<"$res" | wc -l`
if [ "$count" -eq "1" ] ; then
echo $res
echo -en "\007"
sleep 1
echo -en "\007"
sleep 1
echo -en "\007"
fi
done
# chmod u+x check_process_is_end.sh
# ./check_process_is_end.sh
NOTE: RNAhybrid is a process name.
check if a linux process is done using bash
时间: 2024-10-30 02:55:37