From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id F289C1F6A9 for ; Thu, 3 Jan 2019 14:03:35 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 2154A120E58; Thu, 3 Jan 2019 23:03:33 +0900 (JST) Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by neon.ruby-lang.org (Postfix) with ESMTPS id 87B2B120D52 for ; Thu, 3 Jan 2019 23:03:30 +0900 (JST) Received: by filter0032p3las1.sendgrid.net with SMTP id filter0032p3las1-28729-5C2E162D-3D 2019-01-03 14:03:25.534036066 +0000 UTC m=+1180345.468210930 Received: from herokuapp.com (ec2-54-196-1-221.compute-1.amazonaws.com [54.196.1.221]) by ismtpd0029p1iad1.sendgrid.net (SG) with ESMTP id d8Eo7vjOQo65uzRu_k-SGQ for ; Thu, 03 Jan 2019 14:03:25.462 +0000 (UTC) Date: Thu, 03 Jan 2019 14:03:27 +0000 (UTC) From: nobu@ruby-lang.org To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 66295 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 8028 X-Redmine-Issue-Author: Shagabutdinov X-Redmine-Sender: nobu X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS4mC42dW0DnTOPgwoaO4zez8WCGRsBuQg89pL 6IKxkCvXkciDK/tLJpTI0CNLD2LRdQANKObkQtidBJLsg3n/V45GjjR4D3Tb7ngjagqtWDsCA8WpH7 5Z8HVI9T2c6TM6EVFqseFnCGdFhBoFVc69nhvnB1GCgZVvuZip6FDpXtQA== X-ML-Name: ruby-core X-Mail-Count: 90871 Subject: [ruby-core:90871] [Ruby trunk Bug#8028][Rejected] Shellwords.escape works incorrect under windows X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" 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/