From f24d18ca23691be87055e7cc2c4295de6bb97336 Mon Sep 17 00:00:00 2001 From: olli Date: Mon, 25 Mar 2024 21:50:01 +0100 Subject: [PATCH] jobs var --- gaboshlib/g_python.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gaboshlib/g_python.sh b/gaboshlib/g_python.sh index 4e5537a..083da17 100644 --- a/gaboshlib/g_python.sh +++ b/gaboshlib/g_python.sh @@ -2,8 +2,13 @@ function g_python { unset g_python_result g_rnd=$$ + + local g_python_jobs + mapfile -t g_python_jobs < <(jobs -r) + # Use python in backround for multiple python commands running much faster - if [ -z "${g_python_running}" ] + #if [ -z "${g_python_running}" ] + if ! [[ ${g_python_jobs[*]} =~ python-pipeexec.py ]] then mkdir -p ${g_tmp}/${g_rnd} [ -p ${g_tmp}/${g_rnd}/python-in ] || mkfifo ${g_tmp}/${g_rnd}/python-in @@ -21,7 +26,6 @@ function g_python { echo "$@" >${g_tmp}/${g_rnd}/python-in & sleep 0.02 - local g_python_jobs mapfile -t g_python_jobs < <(jobs -r) if ! [[ ${g_python_jobs[*]} =~ python-pipeexec.py ]] then