From: nobu@ruby-lang.org
To: ruby-core@ruby-lang.org
Subject: [ruby-core:90871] [Ruby trunk Bug#8028][Rejected] Shellwords.escape works incorrect under windows
Date: Thu, 03 Jan 2019 14:03:27 +0000 (UTC) [thread overview]
Message-ID: <redmine.journal-76059.20190103140324.f4d9f3772c202959@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-8028.20130306173140@ruby-lang.org
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/
prev parent reply other threads:[~2019-01-03 14:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-06 8:31 [ruby-core:53162] [ruby-trunk - Bug #8028][Open] Shellwords.escape works incorrect under windows Shagabutdinov (Leonid Shagabutdinov)
2019-01-02 17:00 ` [ruby-core:90858] [Ruby trunk Bug#8028] " justin
2019-01-03 14:03 ` nobu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.ruby-lang.org/en/community/mailing-lists/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=redmine.journal-76059.20190103140324.f4d9f3772c202959@ruby-lang.org \
--to=ruby-core@ruby-lang.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).