Files
dotfiles/local/bin/x-until-success
Ismo Vuorinen a708085dda Multiple scripts, go packages, shared configs...
Documentation, links, renaming files for clarity, and all that.
2022-12-19 17:19:00 +02:00

31 lines
480 B
Bash
Executable File

#!/bin/sh
#
# About
# -----
# Repeat the command until it succeeds - always run at least once.
#
#
# License
# -------
#
# Copyright (c) 2013 by Steve Kemp. All rights reserved.
#
# This script is free software; you can redistribute it and/or modify it under
# the same terms as Perl itself.
#
# The LICENSE file contains the full text of the license.
#
#
#
# Run the first time.
#
"$@"
#
# If the status code was not zero then repeat.
#
while [ $? -ne 0 ]; do
"$@"
done