jobs var
This commit is contained in:
parent
f3c1fa5a0b
commit
f24d18ca23
@ -2,8 +2,13 @@ function g_python {
|
|||||||
|
|
||||||
unset g_python_result
|
unset g_python_result
|
||||||
g_rnd=$$
|
g_rnd=$$
|
||||||
|
|
||||||
|
local g_python_jobs
|
||||||
|
mapfile -t g_python_jobs < <(jobs -r)
|
||||||
|
|
||||||
# Use python in backround for multiple python commands running much faster
|
# 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
|
then
|
||||||
mkdir -p ${g_tmp}/${g_rnd}
|
mkdir -p ${g_tmp}/${g_rnd}
|
||||||
[ -p ${g_tmp}/${g_rnd}/python-in ] || mkfifo ${g_tmp}/${g_rnd}/python-in
|
[ -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 &
|
echo "$@" >${g_tmp}/${g_rnd}/python-in &
|
||||||
sleep 0.02
|
sleep 0.02
|
||||||
|
|
||||||
local g_python_jobs
|
|
||||||
mapfile -t g_python_jobs < <(jobs -r)
|
mapfile -t g_python_jobs < <(jobs -r)
|
||||||
if ! [[ ${g_python_jobs[*]} =~ python-pipeexec.py ]]
|
if ! [[ ${g_python_jobs[*]} =~ python-pipeexec.py ]]
|
||||||
then
|
then
|
||||||
|
Loading…
Reference in New Issue
Block a user