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

Re: regression: "sh -c" change causes FTBFS



[CC-ing debian-devel to get more opinions]

On 10/06/2011 04:07 PM, Jonathan Nieder wrote:
>> ocamlbuild's logic is definitively incorrect, but I'm not sure if dash's
>> new behaviour is correct. "bash -c" doesn't skip fork() when a
>> redirection is set up, I guess for a reason. "dash -c" should probably
>> do the same for the same reason.
> 
> Hold on a second.  Dash is not supposed to be a bash emulator. :)
> 
> ksh93 -c "/bin/sleep 100 >dev/null" does skip a fork().  I suspect
> bash does not skip a fork in this case for the same reason that
> 
> 	bash -c 'echo hi; /bin/sleep 100'
> 
> does not skip a fork.

POSIX's Shell and Utilities (XCU) 2.12 [1] does say that "[the]
environment of the shell process shall not be changed by the utility",
and that environment includes open files. My understanding is that
dash's new behaviour (and incidentally, ksh93's one) is incorrect.

[1]
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_12


Cheers,

-- 
Stéphane


Reply to: