[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] doc: mention more about ksh cloexec behavior
From: |
Eric Blake |
Subject: |
Re: [PATCH] doc: mention more about ksh cloexec behavior |
Date: |
Tue, 14 Jun 2011 07:51:22 -0600 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.10 |
[dropping bug-autoconf]
On 06/14/2011 02:04 AM, Stefano Lattarini wrote:
> Hi Eric. I have some minor issues with this patch ...
>
>> +
>> address@hidden
>> +$ @kbd{echo 'echo hello >&5\n' >k
>>
> Why the `\n' here?
Oops. I started with printf '#!/bin/sh\necho hello >&5\n', but then
realized that I didn't always want to run /bin/sh, and changed printf to
echo. Incompletely.
>>
> I'd reorder and rework the above examples as follow:
>
> $ @kbd{bash -c 'exec 5>&-; echo -`bash ./k`-'}
> ./k: line 1: 5: Bad file number
> --
> $ @kbd{ksh -c 'exec 5>&-; echo -`ksh ./k`-'}
> ./k[1]: 5: cannot open [Bad file number]
> --
> $ @kbd{sh -c 'exec 5>&-; echo -`sh ./k`-}
> -hello-
>
> $ @kbd{sh -c 'exec 5>t; echo -`sh ./k`-`cat t`-'}
> --hello-
> $ @kbd{bash -c 'exec 5>t; echo -`bash ./k`-`cat t`-'}
> --hello-
> $ @kbd{ksh -c 'exec 5>t; echo -`ksh ./k`-`cat t`-'}
> ./k[1]: 5: cannot open [Bad file number]
> ---
> $ @kbd{ksh -c '(echo -`ksh ./k`-`cat t`-) 5>t'}
> --hello-
> $ @kbd{ksh -c '{ echo -`ksh ./k`-`cat t`-; } 5>t'}
> --hello-
> $ @kbd{ksh -c 'echo -`5>t ksh ./k`-`cat t`-'}
> --hello-
>
> At this point, the above might as well be broken in two distinct
> examples, which can thus be kept nearer to the descripton of the
> issues they demonstrate.
>
> Note that I'm just saying this makes things clearer *for me*, but
> I don't know if it does for other people too; so your call in the
> end.
Yeah, that does seem better; it was two paragraphs previously, so I
don't mind rearranging it to keep it as two examples. v2 coming up.
--
Eric Blake address@hidden +1-801-349-2682
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature