De notas de lançamento de agosto de 2013:
--line-buffer
will buffer output on line basis.--group
keeps the output together for a whole job.--ungroup
allows output to mixup with half a line coming from one job and half a line coming from another job.--line-buffer
fits between these two; it prints a full line, but will allow for mixing lines of different jobs.
Por exemplo:
parallel --line-buffer <jobs
Onde jobs
contém:
./long.sh
./short.sh one
./short.sh two
short.sh
:
#!/bin/bash
while true; do
echo "short line $1"
sleep .1
done
long.sh
:
#!/bin/bash
count=0
while true; do
echo -n "long line with multiple write()s "
sleep .1
count=$((count+1))
if [ $count -gt 30 ]; then
count=0
echo
fi
done
Saída:
short line one
short line two
short line one
short line two
short line one
**-snip-**
short line one
short line one
short line two
short line two
short line one
short line one
short line one
long line with multiple write()s long line with multiple write()s long line with multiple write()s long line with multiple write()s long line with multiple write()s long line with multiple write()s long line with multiple write()s long line with multiple write()s long line with multiple write()s long line with multiple write()s long line with multiple write()s long line with multiple write()s long line with multiple write()s long line with multiple write()s long line with multiple write()s long line with multiple write()s long line with multiple write()s long line with multiple write()s long line with multiple write()s long line with multiple write()s long line with multiple write()s long line with multiple write()s long line with multiple write()s long line with multiple write()s long line with multiple write()s long line with multiple write()s long line with multiple write()s long line with multiple write()s long line with multiple write()s long line with multiple write()s long line with multiple write()s
short line two
short line two
short line two
short line one