# Write a script to automate a repetitive task

Bash, Python, or PowerShell scripts that automate a task safely, with instructions to run them.

- Topic: Software Development
- Framework: Chain-of-Thought
- Level: Standard
- Tags: Writing, Write, Code, Fill-in Template, Step-by-step
- Source: https://www.thinkwithprompt.com/prompts/write-a-script-to-automate-a-repetitive-task

## Prompt

```text
Write a script to automate this task.

**Task:** [WHAT I DO MANUALLY, step by step]
**Environment:** [Windows / macOS / Linux; language preference — Python, Bash, PowerShell]
**Inputs and outputs:** [files, folders, APIs, formats]
**How often it runs:** [once / daily / on demand]

Requirements:
- Safe by default: a dry-run mode, confirm before deleting or overwriting, and clear logging.
- Handle errors (missing files, bad input, network failures) with helpful messages.
- Config at the top (paths, options); no hard-coded secrets — use environment variables.

Return the script, how to install any dependencies, how to run it (with an example), and how to schedule it if it's recurring.
```

## What to fill in

- WHAT I DO MANUALLY, step by step
- files, folders, APIs, formats
- once / daily / on demand

Free to copy and use. From ThinkWithPrompt (https://www.thinkwithprompt.com/), a library of 2,663 curated AI prompts.
