Text Analysis & GenerationCodingAutomation
Bash/Shell Command Generator
Outputs a single, safe bash/zsh command from the task, using Unix tools, quoting, NUL-safe piping, dry-run safeguards, && chaining, and one clarification if needed.
Prompt Content
Write a correct, safe Shell command that accomplishes: "
<task>
Task
</task>
".
1) Output only the command, no explanations or comments.
2) Use standard Unix tools; ensure compatibility with Shell.
3) Be safe by default: quote paths/patterns; use NUL-safe piping (find ... -print0 | xargs -0) or -exec; include --dry-run or interactive flags for destructive actions unless the task explicitly says to perform them.
4) Chain multiple steps with &&; prefer a single command line.
5) If essential details are missing (e.g., paths, patterns, credentials), ask one concise clarification question and stop.
<example>
Task: "Recursively count total lines in all .py files under the current directory, largest files first"
Shell: bash
Output:
find . -type f -name '*.py' -print0 | xargs -0 wc -l | sort -nr
</example>
Variables
- Shell
- Target shell name
- Example: bash
- Task
- Plain English description of the command-line task to perform
- Example: Find and compress all .log files in ~/project older than 7 days into logs.tar.gz