From: Xin Wang Date: 2010-05-20T14:06:22+09:00 Subject: [ruby-core:30320] [Bug #3321] Kernel#system do not execute command in subshell even if it contains variable assignments Bug #3321: Kernel#system do not execute command in subshell even if it contains variable assignments http://redmine.ruby-lang.org/issues/show/3321 Author: Xin Wang Status: Open, Priority: Normal Category: core ruby -v: ruby 1.9.1p378 (2010-01-10 revision 26273) [i686-linux] When there are variable assignments in command, Kernel#system in Ruby v1.9 execute it using bare fork&exec instead subshell. It cause command execution failed silently. So '=' must also be a special character to be recognized as a sign to execute command in subshell. For example: $ cat ./script.sh #!/bin/sh echo $TEST $ irb irb(main):001:0> system('TEST=test ./script.sh') => nil irb(main):002:0> system('TEST=test ./script.sh 2>/dev/null') test => true irb(main):003:0> ~ ---------------------------------------- http://redmine.ruby-lang.org