Skip to main content

Bash Shell

Useful tips:

  • You can split on input by specifying an internal field separator (IFS), then reading in content via the read command.
    IFS=';' read -ra ADDR <<< "$IN"
    for i in "${ADDR[@]}"; do
    # process "$i"
    done
  • ShellCheck, (GitHub) can be used as a linter for shell scripts.
    • The ShellCheck Wiki provides all of the rules, explanations for why, and examples for the rules checked by ShellCheck