Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quote bug in shell command on windows #6416

Open
p6rt opened this issue Jul 29, 2017 · 7 comments
Open

quote bug in shell command on windows #6416

p6rt opened this issue Jul 29, 2017 · 7 comments

Comments

@p6rt
Copy link

p6rt commented Jul 29, 2017

Migrated from rt.perl.org#131814 (status was 'open')

Searchable as RT131814$

@p6rt
Copy link
Author

p6rt commented Jul 29, 2017

From holli.holzer@gmail.com

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

@p6rt
Copy link
Author

p6rt commented Jul 29, 2017

From @stmuk

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​:

# 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-archive.perl.org/perl6/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>

@p6rt
Copy link
Author

p6rt commented Jul 29, 2017

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Oct 6, 2017

From @stmuk

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"

@p6rt
Copy link
Author

p6rt commented Oct 6, 2017

From @stmuk

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.

@p6rt
Copy link
Author

p6rt commented Oct 6, 2017

From @zoffixznet

On Fri, 06 Oct 2017 09​:49​:54 -0700, steve.mynott+bitcard@​gmail.com wrote​:

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

@p6rt
Copy link
Author

p6rt commented Oct 6, 2017

From @zoffixznet

Possibly introed by this commit​: MoarVM/MoarVM@05a7dc3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant