From: nobu@... Date: 2019-01-03T14:03:27+00:00 Subject: [ruby-core:90871] [Ruby trunk Bug#8028][Rejected] Shellwords.escape works incorrect under windows Issue #8028 has been updated by nobu (Nobuyoshi Nakada). Description updated Status changed from Open to Rejected Escaping ways are various across shells, not only Windows. Use `system` with an array, e.g., `system('echo', '123>')`. ---------------------------------------- Bug #8028: Shellwords.escape works incorrect under windows https://bugs.ruby-lang.org/issues/8028#change-76059 * Author: Shagabutdinov (Leonid Shagabutdinov) * Status: Rejected * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.0.0p0 (2013-02-24) [i386-mingw32] * Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN ---------------------------------------- Shellwords.escape works incorrect under windows (tested for Windows 7 x64), here is example: Actual result: ``` irb(main):001:0> require 'shellwords' => true irb(main):002:0> `echo #{Shellwords.escape( '123>' )} test` # should echo "123> test", but echo nothing => "" irb(main):003:0> File.read( 'test' ) # but writes file "test" => "123\\\n" ``` Expected result: ``` irb(main):001:0> `echo 132^> test` # the correct escape sequence, echoed "123> test" => "132> test\n" ``` Tested for "ruby 2.0.0p0 (2013-02-24) [i386-mingw32]", ruby 1.9.3, but this bug can be found in earlier ruby versions as well. -- https://bugs.ruby-lang.org/ Unsubscribe: