Skip to content

Instantly share code, notes, and snippets.

@mikeslattery
Created January 23, 2020 16:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikeslattery/a9b99e9b06a3a9929a7d3e57855c0065 to your computer and use it in GitHub Desktop.
Save mikeslattery/a9b99e9b06a3a9929a7d3e57855c0065 to your computer and use it in GitHub Desktop.
Lint shell scripts
#!/bin/bash
# Thorough syntax check for #!/bin/sh scripts.
# (For bash scripts, shellcheck by itself is enough)
set -eu
for f in "$@"; do
dash -n "$f" && \
shellcheck -x "$f" && \
checkbashisms "$f"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment