There is a line buffering mode that may help you. "--lb" or "--line-buffer".
On Fri, Jan 21, 2022 at 12:11 PM <parallel-requ...@gnu.org> wrote: > > Send Parallel mailing list submissions to > parallel@gnu.org > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.gnu.org/mailman/listinfo/parallel > or, via email, send a message with subject or body 'help' to > parallel-requ...@gnu.org > > You can reach the person managing the list at > parallel-ow...@gnu.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Parallel digest..." > > > Today's Topics: > > 1. confusion about using parallel to replace a for loop (John) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 21 Jan 2022 09:37:18 -0500 > From: John <gray...@archlinux.us> > To: parallel@gnu.org > Subject: confusion about using parallel to replace a for loop > Message-ID: > <CAO_nJAYz3uwWsjcc7-==_qakh5ttf3cwyykqwkzsuzjzpxx...@mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > When I run the simple script below, initially, there is no output to the > shell until the function finishes. Is there a switch I can use for > parallel so that the function outputs below the sleep command finishes? > > #!/bin/bash > hash=( 1 2 3 4 5 6 7 8 9 ) > > getit() { > echo "this is $1" > sleep 1s > } > > export -f getit > parallel -j 3 getit ::: "${hash[@]}" > > Please cc me on any replies as I am not subscribed to the ML. > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > <https://lists.gnu.org/archive/html/parallel/attachments/20220121/126f4775/attachment.htm> > > ------------------------------ > > Subject: Digest Footer > > _______________________________________________ > Parallel mailing list > Parallel@gnu.org > https://lists.gnu.org/mailman/listinfo/parallel > > > ------------------------------ > > End of Parallel Digest, Vol 141, Issue 3 > ****************************************