Phil for Humanity Phil for Humanity
A Guide for the Survival of Humankind and Helping the World, Society, and Yourself.



Command Loop


I always seem to have the same problem when using Subversion. Basically whenever I try to checkout or update/sync a branch, the Subversion command will fail, and I would have to manually re-run the same command to resume. Typically, this is because of network issues or the Subversion servers are overloaded.

As a result, I wrote a simple script, called Command Loop, that will continuously run the same command until the command completes successfully. This script was written in Python. Here is the script’s usage:


$ cmd_loop.py [COMMAND_WITH_ARGUMENTS]

For example, here is how I download a new Subversion directory.

$ cmd_loop.py svn co https//svnserver.com/abc/def/ghi

You can download this Python script here, or you can copy-n-paste from down below.



by Phil for Humanity
on 20131213

Related Articles
 » Windows Support: Opening a DOS Prompt
 » UNIX Support: Recursively GREP
 » Recursive GREP