I’ll introduce sample code to retry commands until success in Linux /bin/sh
.
/bin/sh
/bin/sh
commands with Amazon ECS Exec/bin/sh
EditionNEXT_WAIT_TIME=0
COMMAND_STATUS=1
while [ $COMMAND_STATUS -ne 0 ]; do
command # exec your command
COMMAND_STATUS=$?
sleep $NEXT_WAIT_TIME
NEXT_WAIT_TIME=$((NEXT_WAIT_TIME+1))
echo $NEXT_WAIT_TIME
done
Above, I wanted to retry commands until success in Linux /bin/sh
.
That’s all from the Gemba.