Bhavya Jain
Bhavya Jain

Reputation: 621

Error on executing gnu parallel command

I am trying to execute a script test3.exp using gnu parallel(as follows):----

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

But every time I am getting this error:---

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

I installed it using apt-get install parallel.

Output for apt-cache policy parallel perl is:---

  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

Please help me with this.

Upvotes: 2

Views: 743

Answers (2)

Nahuel Fouilleul
Nahuel Fouilleul

Reputation: 19335

The version of perl is more recent than /usr/bin/parallel. defined is used to check for entry existence in array or hash

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" : ""),

Upvotes: 1

Bhavya Jain
Bhavya Jain

Reputation: 621

Updating the repository and then updating it using

sudo apt-get install parallel

worked for me.

Contents of apt-cache policy parallel 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

Upvotes: 1

Related Questions