mvdan / sh

A shell parser, formatter, and interpreter with bash support; includes shfmt
https://pkg.go.dev/mvdan.cc/sh/v3
BSD 3-Clause "New" or "Revised" License
7.21k stars 339 forks source link

Question: Why it move the redirection? #931

Closed ale5000-git closed 1 year ago

ale5000-git commented 1 year ago

Hi, why this: echo '>&2 printf "%s\n" "abc"' | shfmt result in this: printf >&2 "%s\n" "abc" ?

mvdan commented 1 year ago

Duplicate of https://github.com/mvdan/sh/issues/389.