From df1addc1ffc42f0f6ed19f252ae665b1277cf622 Mon Sep 17 00:00:00 2001 From: whyour Date: Mon, 1 May 2023 11:05:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20task=20=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E8=B6=85=E6=97=B6=E6=97=B6=E9=97=B4=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shell/task.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/shell/task.sh b/shell/task.sh index ef1ee31e..5d459690 100755 --- a/shell/task.sh +++ b/shell/task.sh @@ -34,7 +34,7 @@ define_program() { handle_log_path() { local file_param=$1 - if [[ -z $file_param ]];then + if [[ -z $file_param ]]; then file_param="task" fi @@ -76,8 +76,10 @@ format_params() { mtime_format="%Y-%m-%d %H:%M:%S.%3N" fi timeoutCmd="" - if type timeout &>/dev/null; then - timeoutCmd="timeout --foreground -s 2 -k 10s $command_timeout_time " + if [[ $command_timeout_time ]]; then + if type timeout &>/dev/null; then + timeoutCmd="timeout --foreground -s 2 -k 10s $command_timeout_time " + fi fi # params=$(echo "$@" | sed -E 's/([^ ])&([^ ])/\1\\\&\2/g') }