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?

Chris
  • 961
  • 7
  • 20
  • 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 '19 at 12:18

1 Answers1

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.

ilkkachu
  • 138,973
  • 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 – Chris Apr 11 '19 at 12:38