Consider this:
cat ../benchmark/*/labels.txt |
while IFS=$'\t' read P1 P2 P3 ; do
[[ $P3 == 76 ]] && echo $P1 $P2
done |
sort -u |
parallel ./build.oct
- you save
awksubprocess withreadlinebuilt-in parser (see comments below) - you avoid dupes with
sort -u - you leverage resource usage with
parallel(orxargs -l1)
Other approach of interest, piloted by awk:
awk -F'\t' '$3==76 && !seen[$1,$2]++ {
print $1 FS $2 | "parallel""parallel ./build.oct"
}' ../benchmark/*/labels.txt
- reuse input field separator
FSinstead of literal - dupes are discarded using an array of counters
- you learn piping to awk subprocess