Skip to main content
2 of 3
edited tags
Jeff Schaller
  • 68.8k
  • 35
  • 122
  • 265

Parallelizing sed gives different output

Trying to parallelize a sed operation however, while the parallel version works, it gives back a wrong output.

The sed operation that I would like to parallelize (works)

sed 's/\s.*$// ; s/\(.*\)/\L\1/' < oldfile.txt > newfile.txt

My Parallel version of the above sed operation (Does not work correctly for some reason):

parallel -a oldfile.txt -k --block $BYTES --pipe-part "sed 's/\s.*$// ; s/\(.*\)/\L\1/'" > newfile.txt
HashWizard
  • 357
  • 2
  • 4
  • 12