Bash Script Linter
Paste a bash script to check for common issues: missing safety flags, unquoted variables, deprecated patterns, and best practice violations. Runs entirely in your browser.
Frequently Asked Questions
Why should I use 'set -euo pipefail'?▼
'set -e' exits on error, 'set -u' treats unset variables as errors, 'set -o pipefail' makes pipelines fail if any command fails (not just the last). Together they prevent scripts from silently continuing after errors. Without these, a script can appear to succeed while producing incorrect results.
Why does this linter warn about unquoted variables?▼
An unquoted variable like $var is subject to word splitting and glob expansion. If the variable contains spaces or special characters, it splits into multiple arguments unexpectedly. Always quote variables: "$var". Use "${var}" inside strings. Exception: inside [[ ]] bash conditionals, quotes are less critical but still a good habit.
What is POSIX compatibility and why does it matter?▼
Bash-specific features like [[ ]], arrays, and process substitution don't work in /bin/sh on systems where sh is dash or another POSIX shell. If your shebang is #!/bin/sh, avoid bashisms. If you need bash features, use #!/bin/bash explicitly.
Why avoid 'ls | grep' to find files?▼
Parsing ls output is fragile — filenames can contain spaces, newlines, and other characters that break text parsing. Use glob patterns (for f in *.log) or find with -exec or -print0/xargs -0 instead.
What is a common mistake with [ ] vs [[ ]]?▼
The single bracket [ ] is a POSIX command that requires quoting. The double bracket [[ ]] is a bash keyword with better handling of empty strings and special characters. Use [[ ]] in bash scripts for string comparisons to avoid unexpected behavior with empty variables.
Related Products
on GumroadPremium Workflow Pack
Production-grade workflows, architecture guides, and deployment scripts for teams that ship. 10 advanced CI/CD workflows (blue-green, canary, E2E, security), 5 architecture deep-dives, code review checklist, PR process guide, and 5 battle-tested Bash deployment scripts.
Buy on Gumroad →Developer Cheat Sheet Bundle
10 print-ready cheat sheets for the tools developers use every day: Git, Docker, Linux CLI, SQL, Regex, HTTP Status codes, VS Code shortcuts, Bash scripting, jq/JSON, and Markdown.
Buy on Gumroad →Developer Productivity Toolkit
Complete dev environment setup: VS Code settings, keybindings, snippets, shell aliases, Git hooks, tmux config, and Starship prompt. Copy, paste, code faster.
Buy on Gumroad →You Might Also Need
Shell Script Linter
Lint Bash and shell scripts online. Detects unquoted variables, missing set -e, unsafe rm -rf, useless cat, backtick usage, and portability issues with line annotations and fix suggestions.
Open free tool →
Docker Compose Generator
Generate docker-compose.yml configurations visually in your browser. Add services, ports, volumes, environment variables, and networks. Export production-ready YAML instantly. Free Docker tool.
Open free tool →
Dockerfile Generator
Interactive wizard to generate production-ready Dockerfiles for Node.js, Python, Go, Java, and Rust. Multi-stage builds, port config, custom layers.
Open free tool →
More Free Tools
Related Articles
Bash Scripting: 20 Scripts Every Developer Needs
Stop doing the same tasks manually. These 20 practical Bash scripts automate deployments, backups, file processing, git workflows, and daily developer tasks — ready to copy and use.
Chmod Calculator: Understand Linux File Permissions Without Memorizing Octal
Use a chmod calculator to set Linux file permissions correctly. Convert between symbolic and octal notation, understand rwx bits, and avoid common permission mistakes.
Top Kubernetes Tools for Developers 2026: Helm, k9s, Lens & More
The essential Kubernetes tools every developer needs in 2026. Hands-on guide to k9s, Lens, Helm, Kustomize, stern, kind, skaffold, and must-have kubectl plugins.
Bun Shell Scripting Guide: Replace Bash Scripts with $.cmd() and Bun APIs
Learn how to replace complex bash scripts with Bun's built-in shell API. Covers $.cmd(), Bun.file(), spawn(), and practical real-world automation scripts.
Lefthook vs Husky vs pre-commit: Git Hooks Manager Comparison 2026
Which git hooks manager should you use in 2026? We compare Lefthook, Husky, and pre-commit on speed, parallel execution, cross-platform support, and monorepo ergonomics with real configuration examples.
Enjoying this tool? Get more like it.
Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.
Unlock AI-Powered Dev Tools
- ⚡ AI Code Review, Doc Generator & SQL Builder
- ⚡ All premium templates & early access
- ⚡ Member discounts on Gumroad products
$9/mo after trial · Cancel anytime
Want the full toolkit?
Get DevPlaybook Pro
Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.
MIT licensed · Instant download · No subscription
See what's included → Browse all deals →