Skip to content

Need to escape $ for externals #1439

@thegedge

Description

@thegedge

Describe the bug
When running an external, $ is always evaluated as an env var, so it must always be escaped. This perhaps applies to other special characters for the shell under which we execute externals.

To Reproduce
Compare

$ ^echo yes | awk '{ print $0 }'

to

$ ^echo yes | awk '{ print \$0 }'
yes

Expected behavior
I would expect one of two possible behaviours:

  1. Since nu doesn't do environment variables at the moment, perhaps escaping would be unnecessary.
  2. Similar to other shells, "..." would interpolate env vars and '...' would not.

Configuration (please complete the following information):

  • OS: OSX
  • Version 10.15.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    A:external-commandsIssues related to external commandsA:parserIssues related to parsingcategory:bugSomething isn't workingpolishthis problem makes nu feel unpolished

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions