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.1k stars 336 forks source link

ksh file name pattern triggers error #913

Closed djwf closed 1 year ago

djwf commented 1 year ago

I ran into an issue using a ksh file name pattern. I've reduced it to a small example:

$ ls
11  test.ksh
$ cat test.ksh
#!/bin/ksh
ls -d {2}(1)
$ ksh ./test.ksh
11
$ ksh --version
  version         sh (AT&T Research) 93u+ 2012-08-01

I know that shfmt support mksh, not plain ksh, but would it be possible to support this type of file name pattern?

If not, no problem, but I figured I'd ask.

mvdan commented 1 year ago

If you mean supporting ksh as a language, see https://github.com/mvdan/sh/issues/614. If you mean something else, please clarify :)

djwf commented 1 year ago

You are correct, that's what I mean, and it seems that I missed that issue. :) So, what could I do to help the ksh get added as a variant?

mvdan commented 1 year ago

In https://github.com/mvdan/sh/issues/614#issuecomment-700637233 I show similar earlier changes, if someone wants to work on a PR. The issue is on my backlog, though my backlog is quite long, and there are quite a few other issues with many more upvotes, like zsh support.