sh icon indicating copy to clipboard operation
sh copied to clipboard

A shell parser, formatter, and interpreter with bash support; includes shfmt

Results 141 sh issues
Sort by recently updated
recently updated
newest added

For example instead of having the export builtin handled by the interpreter, the builtin call is deferred to the `ExecHandler` registered for the interpreter: ``` \export FOO=BAR ``` I don't...

Is it possible to tell `shfmt` to keep indentation as is when the indent is not standard (i.e., not 2, 4 spaces) when breaking lines with line-continuation symbol `\`. For...

In a project where there are shell scripts with a shebang line and no suffix, editorconfig for configuration doesn't work cleanly. If I run `shfmt -w scripts/some-script scripts/other-script.sh` (where `some-script`...

``` --- FAIL: TestRunnerRun (0.02s) --- FAIL: TestRunnerRun/880 (0.00s) interp_test.go:2906: wrong output in "mkdir c; echo '#!/bin/sh\necho b' >c/a; chmod 0755 c/a; c/a": want: "b\n" got: "fork/exec /tmp/interp-test984148057/c/a: text file...

For example, "script" or "shebang", since it really just exposes APIs about looking at script files on disk. I also have become less fond of "util" packages over the years.

enhancement

There now exist dozens of autoformatters covering almost every popular language but I can't find one for makefiles. Makefiles most declare build targets, with a small shell script written beneath...

enhancement
help wanted

coreutils as of 8.27 has a total of 103 executables, ranging from `wc` to `test` and `sort`. Plenty of scripts depend on these. If we really want `interp` to be...

enhancement

The `shfmt` tool altering the following valid code, making it invalid: ```bash coproc foo { echo test } exec {foo[1]}>&- # converts to: exec {foo[1]} >&- ```

bash

I figured since there's already some options for indenting switch cases or putting a space after redirect operators, you also might be open to supporting the following pattern: ```shell f()...

This is a proposal to add support for ksh, alongside mksh. Why I think that ksh support would be good: - imo a common setup is shfmt + ShellCheck. [ShellCheck...