sh
sh copied to clipboard
A shell parser, formatter, and interpreter with bash support; includes shfmt
`gosh` doesn't support it e.g. `echo $(( 2#1010 ))` outputs `0` instead of `10`. Could it be parsed as an arithmetic binary operator for `LangBash`?
Incremental reparsing has been around for a while, but it's getting popular as of recently. The idea is that one can very quickly re-parse an existing file if only a...
I'm seeing e.g. `Redirect.Op` with value `57` i.e. a number, whereas the API asserts the type `RedirOperator` with a method `String()`. It seems that gopher uses the numeric value of...
Your parser permits lazy evaluation of the ternary operator `- ? - : -`, and `gosh` does so: ```sh ~$ gosh $ (( 1 + 1 == 2 ? 1...
As described in https://www.gnu.org/software/bash/manual/html_node/Bourne-Shell-Builtins.html. We have most of them already.
(see commit message) Fixes #911.
* error: Euler:~ #shfmt_v3.5.1_linux_arm64 -i 4 -ci -d -bn -sr 1.sh 1.sh:2:15: a command can only contain words and redirects; encountered ( Euler:~ #cat 1.sh #!/bin/sh **function** watch() { true...
``` $ shfmt --version v3.3.1 ``` Notice `# baz` is indented 2 extra spaces, when it shouldn't be. ### Actual ```sh case foo in # bar "$bar") ;; # baz...
How about adding shell completions for bash/zsh/fish/posh/etc? Thanks. ``` ❯ shfmt - option --binary-next-line binary ops like && and | may start a line -bn binary ops like && and...