Forrest logo
back to the cronic tool

cronic:tldr:bffe8

cronic: Call a command and display its output if it returns a non-zero exit code.
$ cronic ${command}
try on your machine

The command cronic ${command} is used to execute a given command and suppress any output or error messages unless the command fails.

Here's how it works:

  1. The command cronic is a Unix utility that serves as a wrapper for other commands. It captures and reports command output or errors only if the command fails (returns a non-zero exit status). If the command succeeds (returns a zero exit status), cronic will suppress any output.

  2. ${command} is a placeholder that represents the actual command that needs to be executed. It can be replaced with any valid command or a series of commands.

By using cronic ${command}, you can run a command while ignoring the output and errors unless the command fails. This can be useful for automated scripts or crontab entries where you want to receive notifications only when a command fails, but not for successful executions.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the cronic tool