OneLinersCommand workbench
AI
Back to prompts
plain-prompt

Review a Bash script for correctness

Inspect quoting, expansions, pipelines, error handling, portability, and cleanup.

Revision
1
Verified
2026-07-26
Save or explore
Save to collectionCreate a collection in the sidebar first.

Compatibility and paths

GenericWorks with instruction-following chat models.
ChatGPT
Claude Code
Gemini CLI

Trust and provenance

Curated record reviewed 2026-07-26. Results still depend on the supplied context and target environment.

Fill variables

Values stay in this browser tab and are not stored.

Generated asset2 required field(s) must be completed
Objective: Find concrete defects and explain the shell semantics behind them.

Context: Differentiate Bash-specific syntax from POSIX sh.

Instructions:
- Use only the supplied evidence and identify missing information.
- Lead with the finding, confidence, and one safe next action.
- Put read-only checks before mutations and include a stop condition.
- Never request or reproduce secrets, credentials, or private keys.

User request:
Target shell/version:
{{environment}}

Script:
{{evidence}}

Review with line-referenced findings.

Required output:
- Finding
- Evidence
- Confidence
- Safe next check
- Stop condition

Real example

Input

#!/bin/sh
for f in $(find . -name '*.log'); do rm $f; done

Expected result

High risk: command substitution splits filenames and unquoted `$f` expands again. Use `find ... -exec` or a NUL-delimited loop, and add an explicit dry-run before deletion.

Source evidence

GNU Bash manualofficial