This project is closed and read-only.
Actions
Bug #3321
closedKernel#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
Status:
Rejected
Assignee:
-
Description
=begin
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> ~
=end
Actions