Skip to content

Commit

Permalink
Handle FOO=$(command)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattn committed Feb 25, 2019
1 parent 2b0d8a7 commit 9dc3285
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion shellwords.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"errors"
"os"
"regexp"
"strings"
)

var (
Expand Down Expand Up @@ -131,7 +132,7 @@ loop:
}
case '(':
if !singleQuoted && !doubleQuoted && !backQuote {
if !dollarQuote && len(buf) > 0 && buf == "$" {
if !dollarQuote && len(buf) > 0 && strings.HasSuffix(buf, "$") {
dollarQuote = true
buf += "("
continue
Expand Down

0 comments on commit 9dc3285

Please sign in to comment.