Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kernel#system fails with out: $stdout #5865

Open
elia opened this issue Sep 9, 2019 · 0 comments

Comments

@elia
Copy link
Contributor

commented Sep 9, 2019

Environment

  • Darwin Elia.local 18.7.0 Darwin Kernel Version 18.7.0: Tue Aug 20 16:57:14 PDT 2019; root:xnu-4903.271.2~2/RELEASE_X86_64 x86_64

Expected Behavior

⤑ ruby -ve 'system("echo hello world", out: $stdout)'
ruby 2.6.2p47 (2019-03-13 revision 67232) [x86_64-darwin18]
hello world
⤑ 

Actual Behavior

⤑ ruby -ve 'system("echo hello world", out: $stdout)'                          ~
jruby 9.2.6.0 (2.5.3) 2019-02-11 15ba00b Java HotSpot(TM) 64-Bit Server VM 25.25-b02 on 1.8.0_25-b17 +jit [darwin-x86_64]
NotImplementedError: cyclic redirects in child are not supported
  system at org/jruby/RubyKernel.java:1661
  <main> at -e:1

📝 Should be noted that this happens only using $stdout, with other out: destinations works fine:

⤑ ruby -ve 'system("echo hello world", out: $stderr)'                                                                                ~
jruby 9.2.6.0 (2.5.3) 2019-02-11 15ba00b Java HotSpot(TM) 64-Bit Server VM 25.25-b02 on 1.8.0_25-b17 +jit [darwin-x86_64]
hello world
⤑ ruby -ve 'system("echo hello world", out: File.new("/tmp/foo.txt","w"))'                                                           ~
jruby 9.2.6.0 (2.5.3) 2019-02-11 15ba00b Java HotSpot(TM) 64-Bit Server VM 25.25-b02 on 1.8.0_25-b17 +jit [darwin-x86_64]
⤑ cat /tmp/foo.txt                                                                                                                   ~
hello world
⤑                     
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.