Article 56ECM Not Sure how to use parallel command with awk

Not Sure how to use parallel command with awk

by
linux2021
from LinuxQuestions.org on (#56ECM)
Greetings All,

How can I use the parallel command with awk to read millions of lines of numbered patterns. I tried this, but I get errors.

Code:while read line; do

read a b c d <<< "$line"
parallel awk -v v1=$a -v v2=$b -v v3=$c -v v4=$d '$0~v1 && $0~v2 && $0~v3 && $0~v4 {print v1, v2, v3, v4}' gamenums.txt

done < patterns.txtThe errors:

/bin/bash: /bin/bash~v2: No such file or directory
/bin/bash: /bin/bash~v2: No such file or directory
/bin/bash: /bin/bash~v2: No such file or directory
/bin/bash: /bin/bash~v2: No such file or directory
/bin/bash: /bin/bash~v2: No such file or directory
...
etc

The script runs perfectly without the parallel command.

I'm not sure how to use the parallel command. I even tried:

parallel mypatterns.sh

That didn't work either.

I appreciate any suggestions. Thankslatest?d=yIl2AUoC8zA latest?i=QkdT6htFq0A:r96IXHLCFP0:F7zBnMy latest?i=QkdT6htFq0A:r96IXHLCFP0:V_sGLiP latest?d=qj6IDK7rITs latest?i=QkdT6htFq0A:r96IXHLCFP0:gIN9vFwQkdT6htFq0A
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments