Skip to content

Multi-line command substitution does not work #2

@steinybot

Description

@steinybot

Description

A multi-line command substitution is not escaped.

Versions

Component Version
Zsh Escape 3fe0017
OS Windows 10
Zsh zsh 5.0.6 (i686-pc-cygwin)

Steps To Reproduce

Steps to reproduce the bug:

  1. Use the following file bad-script.zsh:
    ref=$(abc \
	    || def)
  1. Run:
zsh-escape.zsh report -d bad-script.zsh

Expected Behaviour

The report finds the start and the end of the command substitution (and fix can escape it).

1 :     ref=$(abc \
DEBUG: Start of command substitution
- Unescaped substitution: $(abc \
- Found an unescaped command substitution
2 : 	    || def)
DEBUG: End of command substitution
- Unescaped substitution: 	    || def)

Actual Behaviour

It thinks that there is a variable with no name.

1 :     ref=$(abc \
- Unescaped variable: $
- Found an unescaped variable
2 : 	    || def)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions