Automation, Orchestration, and Scripting

An administrator needs an AI assistant to draft a script that compresses application logs older than 14 days on a RHEL 9 server. Which prompt is MOST likely to produce a usable first draft?

Show the answer

Correct answerC. Write a Bash script for RHEL 9 that gzips files in /var/log/myapp older than 14 days and reports each action to syslog.

A prompt that names the shell, distribution, path, age threshold and logging behavior gives the model the context and constraints it needs. The vague options only state goals or quality ('production-grade', 'no bugs') and leave the model to guess the details.