2017-06-22 190 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" : ""),