Skip to content

kazhuravlev/repeat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

repeat

A simple Go tool to repeat commands multiple times with optional delays.

Installation

go install github.com/kazhuravlev/repeat/cmd/repeat@latest

Usage

repeat <count> [delay] <command> [args...]

Examples

Basic repetition

# Ping a server 5 times
repeat 5 ping -c 1 google.com

# Check system time 10 times
repeat 10 date

With delay between executions

# Health check every 2 seconds, 10 times
repeat 10 2s curl -s https://api.example.com/health

# Monitor disk usage every minute, 5 times
repeat 5 1m df -h

Real-world use cases

# Stress test an API endpoint
repeat 100 curl -X POST https://api.example.com/test

# Watch for a service to come online
repeat 30 1s nc -zv localhost 8080

# Collect performance metrics
repeat 20 500ms ps aux | grep nginx

Notes

  • Commands are executed sequentially
  • Exit codes are ignored - repeat continues even if commands fail
  • Delay format supports Go duration syntax: 1s, 500ms, 2m30s, etc.

About

Repeat shell command several times

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages