parallel icon indicating copy to clipboard operation
parallel copied to clipboard

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

Open FrancescElies opened this issue 6 years ago • 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

FrancescElies avatar Feb 01 '18 19:02 FrancescElies

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..)

ChrisJefferson avatar Feb 02 '18 16:02 ChrisJefferson

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)

FrancescElies avatar Feb 04 '18 08:02 FrancescElies

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 ?

japrogramer avatar Feb 04 '18 21:02 japrogramer

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.

zwieberl avatar Aug 27 '18 06:08 zwieberl