[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Piping sed stalls on OpenSolaris 2010.03

From: Mats Erik Andersson
Subject: Piping sed stalls on OpenSolaris 2010.03
Date: Fri, 13 Apr 2012 12:32:01 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

Dear all,

at some stage the generated make file "lib/Makefile" began using
a three-member pipe for sed in order to generate "lib/unistd.h" and
"lib/wchar.h". This change is not portable to OpenSolaris 2010.03
using snv_134, since "make" as well as "gmake" stalls at

  GEN unistd.h

  GEN wchar.h

and only at these. The change took place somewhere between the release
of inetutils-1.8 and inetutils-1.9.1! However, neither NexentaCore with
snv_134f, nor OpenIndiana are affected by the present issue.

The problem is that "modules/unistd" and "modules/wchar" are, as sole
modules, implementing a rewrite action using the template model

    { echo "A comment";
      sed -e 's,re,txt,g' < file |
      sed -e 's,re2,txt2,g' |
      sed -e 's,re3,txt3,g'; } > outfile

All other modules implement pipes using one or two levels, not three.
This three level construct stalls on OpenSolaris 2010.03, presumably
waiting for input, since the expected output file contains only the
comment at inspection time after abortion. Rewriting the make file
to implement the shorter pipe

    { echo "A comment";
      sed -e 's,re,txt,g' < file > tmpfile ;
      sed -e 's,re2,txt2,g' < tmpfile |
      sed -e 's,re3,txt3,g'; } > outfile

fully resolves the issue with said OpenSolaris variant.

It is conceivable that the issue arises since the Korn shell
does not execute the final pipe member in a subshell, but since
neither OpenBSD, nor some other OpenIndiana/OpenSolaris systems
display the same behaviour, the matter is convoluted! Still,
I recommend a reformulation of the sed-scripting as found in
"modules/unistd" and "modules/wchar".

Best regards,
  Mats Erik Andersson, ex officio GNU Inetutils.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]