2017-06-22 207 views
2

我试图执行一个脚本test3.exp使用GNU平行(如下):----错误上执行GNU并行命令

seq 1 3 | parallel test3.exp data{}/ 

但每次我收到此错误:---

Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at /usr/bin/parallel line 119. 

我使用apt-get install并行安装它。

为输出的apt-缓存策略并行Perl是:---

[email protected]:/usr/bin$ apt-cache policy parallel perl 
    parallel: 
    Installed: 20120422-1 
    Candidate: 20141022+ds1-1 
    Version table: 
     20141022+ds1-1 500 
      500 http://in.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages 
      500 http://in.archive.ubuntu.com/ubuntu xenial/universe i386 Packages 
    *** 20120422-1 100 
      100 /var/lib/dpkg/status 
    perl: 
    Installed: 5.22.1-9 
    Candidate: 5.22.1-9 
    Version table: 
    *** 5.22.1-9 500 
      500 http://in.archive.ubuntu.com/ubuntu xenial/main amd64 Packages 
      100 /var/lib/dpkg/status 

请帮助我。

回答

1

更新资料库,然后使用

sudo apt-get install parallel 

为我工作进行更新。

内容的apt-缓存策略并行的Perl: -

[email protected]:~/Documents/script$ apt-cache policy parallel perl 
    parallel: 
     Installed: 20141022+ds1-1 
     Candidate: 20141022+ds1-1 
     Version table: 
    *** 20141022+ds1-1 500 
      500 http://in.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages 
      500 http://in.archive.ubuntu.com/ubuntu xenial/universe i386 Packages 
      100 /var/lib/dpkg/status 
    perl: 
     Installed: 5.22.1-9 
     Candidate: 5.22.1-9 
     Version table: 
    *** 5.22.1-9 500 
      500 http://in.archive.ubuntu.com/ubuntu xenial/main amd64 Packages 
      100 /var/lib/dpkg/status 
0

的perl的版本比在/ usr/bin中/并行更近。 defined用于检查是否存在阵列或散列

defined($array[2]) 
defined($hash{"word"}) 

# what causes error in parallel (20120422) 
119: ((defined @::opt_v) ? "-vv" : ""), 
# what is suggested in error message 
119: ((@::opt_v) ? "-vv" : ""),