Skip Menu |
Report information
Id: 131814
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: holli.holzer [at] gmail.com
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Date: Sat, 29 Jul 2017 17:28:56 +0200
To: rakudobug [...] perl.org
Subject: quote bug in shell command on windows
From: Holli Holzer <holli.holzer [...] gmail.com>
Download (untitled) / with headers
text/plain 358b
good localtime()

I was told to write here after a conversation on irc. when i run the following code under rakudo 2017.07 on windows 8.1

    shell qq[echo "foo"];

the output is 

    \"foo"

which is incorrect. It should be 
    
    "foo"

This bug effectively prevents from shelling out to a program while using quoted strings as arguments.

tx for listening


Subject: Re: [perl #131814] quote bug in shell command on windows
From: Steve Mynott <steve.mynott [...] gmail.com>
To: perl6-compiler <perl6-compiler [...] perl.org>
Date: Sat, 29 Jul 2017 19:59:04 +0100
CC: bugs-bitbucket [...] rt.perl.org
Download (untitled) / with headers
text/plain 992b
On Windows 10 rakudo star 2017.07 I get \"foo\" Proc.new(in => IO::Pipe, out => IO::Pipe, err => IO::Pipe, exitcode => 0, signal => 0, command => ["echo \"foo\""]) whereas on FreeBSD 10 I get foo only (no quotes or Proc.new structure) S On 29 July 2017 at 16:29, Holli Holzer <perl6-bugs-followup@perl.org> wrote: Show quoted text
> # New Ticket Created by Holli Holzer > # Please include the string: [perl #131814] > # in the subject line of all future correspondence about this issue. > # <URL: https://rt.perl.org/Ticket/Display.html?id=131814 > > > > good localtime() > > I was told to write here after a conversation on irc. when i run the > following code under rakudo 2017.07 on windows 8.1 > > shell qq[echo "foo"]; > > the output is > > \"foo" > > which is incorrect. It should be > > "foo" > > This bug effectively prevents from shelling out to a program while using > quoted strings as arguments. > > tx for listening
-- 4096R/EA75174B Steve Mynott <steve.mynott@gmail.com>
Download (untitled) / with headers
text/plain 185b
I don't think this is a bug in the shell command on windows since cmd.exe behaves differently to Bourne type shells. UNIX $ echo "foo" foo Windows C:\Windows\system32>echo "foo" "foo"
Download (untitled) / with headers
text/plain 215b
There does seem to be a quoting bug in Windows shell but none of the above examples show it. See #132183: Insufficient debug messages from zef/perl6.bat when package build fails I propose this ticket be closed.
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 450b
On Fri, 06 Oct 2017 09:49:54 -0700, steve.mynott+bitcard@gmail.com wrote: Show quoted text
> I propose this ticket be closed.
No, there's definitely some bug exists. On 2017.07 Star, I get this (\x[22] is the double-quote char): C:\Users\zoffix>perl6 -e "say qqx/echo \x[22]foo\x[22]/;" \"foo\" While the presence of quotes is a thing of Windows's shell, looks like rakudo tries to escape the quotes (incorrectly?) and the slashes make it into the output
Possibly introed by this commit: https://github.com/MoarVM/MoarVM/commit/05a7dc3


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org