On Thu, May 4, 2017 at 6:32 AM, Michael MacIsaac <mike99...@gmail.com> wrote:
> Hello list, > > <snip> > > > local nextLine > while read nextLine; do > zVerbose "calling zSetOneSystem $nextLine" > zSetOneSystem $nextLine > done < <(echo "$expList") > > This was my first attempt at the loop: > > echo "$expList" | > while read nextLine; do > zVerbose "calling zSetOneSystem $nextLine" > zSetOneSystem $nextLine > done > Both of the above loops use "read", which reads "lines" from stdin. Is anything within the while loop reading from stdin (remember that stdin will propagate to sub-shells & fork()'d processes so they can exhaust the "parent's" stdin)? If so, that is probably what is causing your problem. The "something" is exhausting the stdin. Note that ssh will do this to you unless your ssh command has the "-n" switch on it. > > Both flavors of the loop above have this behavior: > 1) If the -n flag (no operation) is passed, the loop runs fine to > completion. > 2) If that flag is not passed, the loop runs, processes one system (which > results in files being changed on disk), but then the loop simply stops. > > When I trace it, the 'read nextLine' fails. I print out 'expList' after > the loop and all records are still in place. How can a sub-process affect > the parent this way? I've narrowed it down to two resulting bash script > calls nested deeper in zSetOneSystem(). If I comment out those two, the > loop succeeds. If I un-comment either of the two bash scripts, the loop > fails as described. Strange. > > Any help will be appreciated. > > Thanks. > > > -- > -Mike MacIsaac > > ---------------------------------------------------------------------- > For LINUX-390 subscribe / signoff / archive access instructions, > send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or > visit > http://www.marist.edu/htbin/wlvindex?LINUX-390 > ---------------------------------------------------------------------- > For more information on Linux on System z, visit > http://wiki.linuxvm.org/ > -- Advertising is a valuable economic factor because it is the cheapest way of selling goods, particularly if the goods are worthless. -- Sinclair Lewis Maranatha! <>< John McKown ---------------------------------------------------------------------- For LINUX-390 subscribe / signoff / archive access instructions, send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390 ---------------------------------------------------------------------- For more information on Linux on System z, visit http://wiki.linuxvm.org/