Shell

The Shell badge, lettered “Pipe Fitters Union, Local 0, since 1971” round its band
Files
.sh .bash .ksh .zsh
Formats as
Ur
Lints
Every rule that reads its code
In ur.toml
[format.shell]

Formatted

cart.sh, as written
#!/usr/bin/env bash
# What a cart costs: the sum of each item's price times its quantity, read from a CSV file of items.
set -euo pipefail
test -f "$1" || { echo "usage: cart.sh items.csv" >&2; exit 1; }
tail -n +2 "$1" | awk -F, '{ sum += $2 * $3 } END { printf "%.2f\n", sum }' | tee --append subtotals.log
ur format --style ur cart.sh
#!/usr/bin/env bash
# What a cart costs: the sum of each item's price times its quantity, read from
# a CSV file of items.
set -euo pipefail
test -f "$1" || { echo "usage: cart.sh items.csv" >&2; exit 1; }
tail -n +2 "$1" | awk -F, '{ sum += $2 * $3 } END { printf "%.2f\n", sum }' |
    tee --append subtotals.log

Try it in the playground →

Versions

Ur reads Shell as the profiles below name it. Name the versions a project targets in target; without it, Ur reads shell-bash-5.3.

ProfileDialect
shell-posix-2008POSIX
shell-posix-2024POSIX
shell-bash-3.2Bash
shell-bash-4.0Bash
shell-bash-4.1Bash
shell-bash-4.2Bash
shell-bash-4.3Bash
shell-bash-4.4Bash
shell-bash-5.0Bash
shell-bash-5.1Bash
shell-bash-5.2Bash
shell-bash-5.3Bash
shell-ksh-88Ksh
shell-ksh-93Ksh
shell-zsh-5.9Zsh