Closed hbarcelos closed 2 years ago
Looks like <<<
is not POSIX, so I needed to change shell_variant
to bash
, then the issue went away.
Hrm, we should probably give a better error in that case though, because a POSIX <<
cannot possibly be followed by a <
. We already give a helpful error in other scenarios, like when one tries to use Bash arrays in POSIX mode.
$ cat array.sh
foo=(bar)
$ shfmt -ln=bash array.sh
foo=(bar)
$ shfmt -ln=posix array.sh
array.sh: array.sh:1:5: arrays are a bash/mksh feature
$ cat herestring.sh
foo <<< bar
$ shfmt -ln=bash herestring.sh
foo <<<bar
$ shfmt -ln=posix herestring.sh
herestring.sh: herestring.sh:1:5: << must be followed by a word
The last one could say something like herestrings are a bash/mksh feature
.
shfmt
is having issues with the herestring operator (<<<
).The minimum reproducible example:
If I run:
I get: