我正在尝试使用gnu parallel执行脚本test3.exp(如下所示):----
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 parallel安装它。
apt-cache策略并行perl的输出是:---
bhavya@guavus:/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
请帮助我。
答案 0 :(得分:1)
更新存储库,然后使用
更新它sudo apt-get install parallel
为我工作。
apt-cache策略并行perl的内容: -
bhavya@guavus:~/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
答案 1 :(得分:1)
perl的版本比/ usr / bin / parallel更新。
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" : ""),