Ralph Corderoy (2023-01-26 10:46:19) Permalink
So it's like bash's

n=3; while ((n--)); do foo || break; done

or zsh's

repeat 3 foo || break

Given it runs the command up to N times, perhaps zero if the first execve(2) fails, perhaps upto reads well.

upto 3 ls /etc/motd

Laurence Tratt (2023-01-26 12:01:37) Permalink
@Ralph Yes, you can definitely encode the same thing (more or less laboriously) in the shell, though as you say, it tends to be different in each shell -- and, in some, distinctly unmemorable! [FWIW, I've also found the -v switch in try_repeat more useful than I first expected. It's quite useful to get a sense of how often a non-deterministic failure occurs.]