📄 check_exec_guard.sh
字号:
#! /bin/sh# $Id: check_exec_guard.sh,v 1000.1 2004/02/12 21:52:32 gouriano Exp $# Author: Vladimir Ivanov, NCBI ############################################################################## Auxiliary time-guard script for run check command script## Usage:# check_exec_guard.sh <timeout> <pid>## timeout - maximal time of execution process with "pid" in seconds# # Note:# If process with "pid" still execute after "timeout" seconds, that # it will be killed and exit code from this script will be 1. # Otherwise exit code 0 will be returned to parent shell.############################################################################# Parameterstimeout=$1pid=$2sleep_time=5# Wait while [ $timeout -gt 0 ]; do kill -0 $pid > /dev/null 2>&1 || exit 0 if [ $timeout -lt $sleep_time ]; then sleep_time=$timeout fi timeout="`expr $timeout - $sleep_time`" sleep $sleep_timedone# Time out, kill the processechoecho "Maximum execution time of $1 seconds is exceeded"echokill $pid > /dev/null 2>&1sleep $sleep_timekill -9 $pid > /dev/null 2>&1exit 1# # ===========================================================================# PRODUCTION $Log: check_exec_guard.sh,v $# PRODUCTION Revision 1000.1 2004/02/12 21:52:32 gouriano# PRODUCTION PRODUCTION: UPGRADED [CORE_001] Dev-tree R1.7# PRODUCTION# ===========================================================================#
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -