[#9722] Kernel#system broken inside Dir.chdir(&block) if system command doesn't have shell characters — <noreply@...>

Bugs item #7278, was opened at 2006-12-14 13:59

8 messages 2006/12/14

[#9749] System V IPC in standard library? — Steven Jenkins <steven.jenkins@...>

Back in August, I needed a semaphore to serialize access to an external

14 messages 2006/12/19

[#9753] CVS freeze — SASADA Koichi <ko1@...>

Hi,

20 messages 2006/12/20
[#9755] Re: [ruby-dev:30039] CVS freeze — SASADA Koichi <ko1@...> 2006/12/20

Hi,

[#9757] Re: [ruby-dev:30040] Re: CVS freeze — SASADA Koichi <ko1@...> 2006/12/20

Hi,

Re: [ ruby-Bugs-7278 ] Kernel#system broken inside Dir.chdir(&block) if system command doesn't have shell characters

From: Eric Hodel <drbrain@...7.net>
Date: 2006-12-20 22:58:06 UTC
List: ruby-core #9767
On Dec 15, 2006, at 18:09, Nobuyoshi Nakada wrote:
> At Fri, 15 Dec 2006 06:59:52 +0900,
> <noreply@rubyforge.org> wrote in [ruby-core:09722]:
>> % ruby -v -e 'Dir.chdir("p4") { system "/usr/local/bin/p4 info" }'
>> ruby 1.8.5 (2006-08-25) [i686-darwin8.8.1]
>> Perforce client error:
>>         Connect to server failed; check $P4PORT.
>>         TCP connect to perforce failed.
>>         perforce: host unknown.
>
> Could you elaborate the problem?
>
> * does work without Dir.chdir
>   (chdir p4; ruby -e 'system "/usr/local/bin/p4 info"')
>
> * does work with -C option
>   ruby -C p4 -e 'system "/usr/local/bin/p4 info"'
>
> * does work outside chdir block
>   ruby -e 'Dir.chdir("p4"); system "/usr/local/bin/p4 info"'
>
> Also, do them work with "printenv P4PORT" instead of
> /usr/local/bin/p4?

There's a minimal test case in [ruby-talk:230639].

-- 
Eric Hodel - drbrain@segment7.net - http://blog.segment7.net

I LIT YOUR GEM ON FIRE!


In This Thread