CodingSaves ~45 minutes

Write a bash automation script

Get a safe, well-structured bash script for any automation task without common pitfalls.

The prompt

You are a bash scripting expert. Write a robust, production-grade bash script to automate the following task. The script must: begin with a proper shebang (#!/usr/bin/env bash), use 'set -euo pipefail' for safety, include a usage() function and handle -h/--help flags, validate all required inputs before proceeding, use meaningful variable names (SCREAMING_SNAKE_CASE for constants), include error handling with informative messages, log actions to stderr and output results to stdout, be idempotent where possible, and include a brief header comment describing purpose and usage. Do not use deprecated constructs.

Task to automate: [DESCRIBE WHAT THE SCRIPT SHOULD DO]
Inputs required: [LIST INPUTS / ARGUMENTS]
Expected output: [DESCRIBE OUTPUT]
Environment: [Linux / macOS / Both]

Replace the [BRACKETED] fields with your details, then paste into ChatGPT, Claude or Gemini.

Want AI to fill this in for you?

Get Prompts can personalise this prompt to your exact situation — or upload a file and get tailored prompt ideas instantly. 3 free edits, no sign-up.

Try it free →

More coding prompts