{"id":16164835,"url":"https://github.com/ltratt/try_repeat","last_synced_at":"2025-10-29T00:14:26.646Z","repository":{"id":66490146,"uuid":"593137237","full_name":"ltratt/try_repeat","owner":"ltratt","description":"Run a command 'n' times, exiting early if the command returns non-zero","archived":false,"fork":false,"pushed_at":"2025-03-14T15:24:03.000Z","size":18,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-14T16:29:14.159Z","etag":null,"topics":["shell","unix"],"latest_commit_sha":null,"homepage":"https://tratt.net/laurie/src/try_repeat/","language":"Roff","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ltratt.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-25T10:25:18.000Z","updated_at":"2025-03-14T15:24:07.000Z","dependencies_parsed_at":"2023-03-04T22:00:19.216Z","dependency_job_id":null,"html_url":"https://github.com/ltratt/try_repeat","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ltratt%2Ftry_repeat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ltratt%2Ftry_repeat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ltratt%2Ftry_repeat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ltratt%2Ftry_repeat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ltratt","download_url":"https://codeload.github.com/ltratt/try_repeat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246472654,"owners_count":20783227,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["shell","unix"],"created_at":"2024-10-10T02:48:03.615Z","updated_at":"2025-10-29T00:14:26.575Z","avatar_url":"https://github.com/ltratt.png","language":"Roff","funding_links":[],"categories":[],"sub_categories":[],"readme":"# try_repeat\n\n`try_repeat` tries to run a command *n* times, exiting early if the command\nexits with a non-zero exit code. This is useful when trying to find\nintermittent failures in a command.\n\n\n# Usage\n\n```sh\ntry_repeat [-ehv] \u003ccount\u003e \u003ccommand\u003e [\u003carg1\u003e ... \u003cargn\u003e]\n```\n\nOptions:\n\n * `-e` Sets an environment variable `TRY_REPEAT_I` with the current execution\n    number. Starts at 1.\n * `-v` Print out the iteration number before executing `\u003ccommand\u003e`.\n\n`try_repeat` exits with the exit code of the last iteration of `\u003ccommand\u003e`.\n\n\n# Examples\n\n```sh\n$ try_repeat 3 ls /etc/motd\n/etc/motd\n/etc/motd\n/etc/motd\n$ echo $?\n0\n$ try_repeat 3 ls /doesntexist\nls: /doesntexist: No such file or directory\n$ echo $?\n1\n$ try_repeat -v 3 ls /etc/motd\n===\u003e 1: ls /etc/motd\n/etc/motd\n===\u003e 2: ls /etc/motd\n/etc/motd\n===\u003e 3: ls /etc/motd\n/etc/motd\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fltratt%2Ftry_repeat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fltratt%2Ftry_repeat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fltratt%2Ftry_repeat/lists"}