Skip to content

Invoking external command lines (utilities) is broken with respect to quoting on Unix #3734

Closed

Description

Related: #3733

Steps to reproduce

/bin/sh -c "echo 'hi, mom'"
/bin/sh -c 'echo "hi, mom"'

Expected behavior

hi, mom
hi, mom

Actual behavior

hi, mom
hi,

The following literals should be passed through to sh (there's nothing for PowerShell to interpret here):

echo 'hi, mom'
echo "hi, mom"

To a POSIX-like shell, these two commands are equivalent (not generally, but with the given strings).

Unexpectedly, in the case of the 2nd command, 2 arguments are passed ($<n> represents the n-th positional parameter):

$1=[echo hi,]
$2=[mom]

Environment data

PowerShell Core v6.0.0-alpha (v6.0.0-alpha.18) on macOS 10.12.4
PowerShell Core v6.0.0-alpha (v6.0.0-alpha.18) on Ubuntu 16.04.1 LTS

Activity

  1. changed the title [-]Invoking external command lines is broken with respect to quoting on Unix[/-] [+]Invoking external command lines (utilities) is broken with respect to quoting on Unix[/+] on May 8, 2017
  2. TSlivede commented on May 24, 2017

    @TSlivede

    Am I wrong, or is this a duplicate of #1995 and #3049 ?

    I hope that this will be solved, RFC:
    PowerShell/PowerShell-RFC#90

  3. SteveL-MSFT commented on May 24, 2017

    @SteveL-MSFT
    Member

    TSlivede you're right, resolving as dupe and making the original higher priority

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions