1

Suppose I have the following command to be parallelized:

my_command --file <(my | pipeline)

Now, I would like to parallelize in specific chunks:

my | pipeline | parallel --spreadstdin my_command --file <(parallel's stdin)

How would I accomplish this redirection with gnu parallel?

  • If your program does not read from STDIN, then you can use --fifo and --cat. If the question is re-opened I will post an answer. – Ole Tange Apr 11 at 12:18
1

If I understand this right, parallel --spreadstdin sends the blocks of input piped to the stdin of the processes it runs, so it's not Parallel's stdin you want my_command to read from, but its own.

If my_command doesn't default to reading stdin, you can usually use /dev/stdin in place of a filename, it resolves to the same file/pipe as the "original" stdin.

So

my | pipeline | parallel --spreadstdin my_command --file /dev/stdin

should be what you want.

  • its kind of a "why would you want to do that" situation, until you are slinging around a bunch of codes you don't have time to edit, all with different input interfaces. Thanks man – donlan Apr 11 at 12:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.