小编Mar*_*rry的帖子

GNU Parallel - 全局变量和函数

我有这个脚本:

GLOBAL_VAR="some global value"

function test
{
  echo $1
  echo ${GLOBAL_VAR}
}

export -f test  
parallel --jobs 5 --linebuffer test ::: "${files[@]}"
Run Code Online (Sandbox Code Playgroud)

我怎样才能$GLOBAL_VAR从并行可见?

linux sh gnu-parallel

4
推荐指数
1
解决办法
1776
查看次数

标签 统计

gnu-parallel ×1

linux ×1

sh ×1