Creators to follow

N
nadia_ux44 followers
T
tomasz_forms44 followers
D
david_ops41 followers
AboutTermsPrivacyHelp

© 2026 teliprompt

AH
ahmed_go
7 months ago•
Coding

Shell script linter with common pitfall detection

Claude Sonnet 4.6
code output
#bash
#shell
#linter
#devops
#static-analysis
Views
8.9K
Copies
2.5K
Likes
1.7K
Comments
0
Copy rate
28.0%

Prompt

Act as a senior DevOps engineer. Write a Bash linter script that scans a shell script and reports common pitfalls.

Input script to lint: [input_script]
Lint severity threshold: [severity_threshold]

Detect at minimum these issues, with file/line number and a short fix hint:
1. Unquoted variable expansions (e.g. `rm $file` instead of `rm "$file"`)
2. Use of `[ ... ]` instead of `[[ ... ]]`
3. Parsing `ls` output (e.g. `for f in $(ls)`)
4. Missing `set -euo pipefail` at the top
5. Use of backticks instead of `$(...)`
6. `cd` without checking exit code
7. Writing to a temp file without `mktemp`
8. Deprecated `echo -e` — recommend `printf`
9. Hardcoded absolute paths under `/tmp` or `/home`
10. Pipelines without `pipefail` awareness

Severity levels: info, warn, error. Threshold filters which are printed.

Output format:
- A single `lint.sh` file that runs `bash lint.sh <script-to-lint>`
- Readable colorized terminal output (red/yellow/blue) with ANSI codes
- Final summary line with counts per severity
- Exit 0 if no errors at threshold, exit 1 otherwise
- Include 3 lines of sample output at the bottom in a comment block

Customise this prompt

Fill in 2 variables to personalise this prompt

Preview
Act as a senior DevOps engineer. Write a Bash linter script that scans a shell script and reports common pitfalls. Input script to lint: [input_script] Lint severity threshold: [severity_threshold] Detect at minimum these issues, with file/line number and a short fix hint: 1. Unquoted variable expansions (e.g. `rm $file` instead of `rm "$file"`) 2. Use of `[ ... ]` instead of `[[ ... ]]` 3. Parsing `ls` output (e.g. `for f in $(ls)`) 4. Missing `set -euo pipefail` at the top 5. Use of backticks instead of `$(...)` 6. `cd` without checking exit code 7. Writing to a temp file without `mktemp` 8. Deprecated `echo -e` — recommend `printf` 9. Hardcoded absolute paths under `/tmp` or `/home` 10. Pipelines without `pipefail` awareness Severity levels: info, warn, error. Threshold filters which are printed. Output format: - A single `lint.sh` file that runs `bash lint.sh <script-to-lint>` - Readable colorized terminal output (red/yellow/blue) with ANSI codes - Final summary line with counts per severity - Exit 0 if no errors at threshold, exit 1 otherwise - Include 3 lines of sample output at the bottom in a comment block

Example output

Related prompts

Async iterators and generators in modern JavaScript: a working guideby @olivia_test
Coding
TypeScript type narrowing cheat sheet with runnable examplesby @marcus_react
Coding
CLI tool builder with argument parsing and colored outputby @nikolai_rust
Coding
Convert JavaScript to strict TypeScript with full type safetyby @marcus_react
Coding