I cannot reproduce the problem (neither with bash nor with dash).   I get

... read(3, "I am a.sh.......\n", 4096) = 17 read(3, "I am gonna die ........\n", 4096) = 24 --- SIGCHLD (Child exited) @ 0 (0) --- read(3, "", 4096) = 0 fstat(3, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0 close(3) = 0 ...

(Perl 5.12.4, current versions of dash/bash as they ship with Ubuntu 11.10)

Update: err wait... you're probably not killing the sleep, but the shell only (in which case the sleep subprocess may survive (depending on the shell settings)).  Try killing sleep directly, or kill the entire process group (use "ps fo pid,pgrp,comm" to find out, then "kill -15 -PGRP").


In reply to Re: parent process stuck in read(2) on pipe opened to child process using backtick by Eliya
in thread parent process stuck in read(2) on pipe opened to child process using backtick by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.