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


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