我正在尝试使用 gnu 并行执行脚本 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 安装并行安装它。
apt-cache policy parallel 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
请帮我解决这个问题。
更新存储库,然后使用
sudo apt-get install parallel
为我工作。
apt-cache policy 并行 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
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" : ""),