mmstick/parallel

parallel: command error: I/O error: No such file or directory (os error 2)

FrancescElies opened this issue · 4 comments

Issue

Using parallel version MIT/Rust Parallel 0.11.3

Steps to Test

  1. Execute script
#!/usr/bin/env bash

parallel echo ::: 1 2 ::: A B

Output:

1 A
1 B
2 A
2 B
  1. Execute script
#!/usr/bin/env bash
my_function() {
    echo $1 $2
    echo "more things"
}
export -f my_function
parallel my_function ::: 1 2 ::: A B

Output:

parallel: command error: I/O error: No such file or directory (os error 2)
parallel: command error: I/O error: No such file or directory (os error 2)
parallel: command error: I/O error: No such file or directory (os error 2)
parallel: command error: I/O error: No such file or directory (os error 2)
parallel: encountered errors during processing:
1: 1 A: I/O error: No such file or directory (os error 2)
2: 1 B: I/O error: No such file or directory (os error 2)
3: 2 A: I/O error: No such file or directory (os error 2)
4: 2 B: I/O error: No such file or directory (os error 2)

Am I doing something wrong in the second example?
I am on Mac OS

Thanks for your support

Parallel only runs programs, not shell commands, by default. I put my_function into a shell script and run that script (there may be a way of making it run shell commands..)

I see, thanks for the reply.
Gnu parallel supports the execution of shell commands, do we want to keep this issue open or shall I close? (either way is fine with me)

Open, Im trying this line with rust parallel but i get the same error
(echo google.com; echo yahoo.com) | parallel 'traceroute {}'
however in gnu parallel the equivalent line here works
(echo google.com; echo yahoo.com) | time parallel -k -j+0 traceroute

also what is the rust-parallel equivalent to gnu-parallels -k ?

Just to add another voice:
I would also like to have the ability to execute shell-functions within a script, exactly as described by the OP.